View Single Post
Old 12-15-2014, 02:46 PM   #1
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 74,043
Karma: 315160596
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
initialize() documentation

The documentation for initialize() says:

Quote:
Called once when calibre plugins are initialized. Plugins are re-initialized
every time a new plugin is added.

Perform any plugin specific initialization here, such as extracting
resources from the plugin zip file. The path to the zip file is
available as ``self.plugin_path``.

Note that ``self.site_customization`` is **not** available at this point.
'''
pass
On a plugin I'm running it seems that initialize() is being called every time the plugin runs, not just the plugins is added to calibre.

Is this expected behaviour? If so, when should a plugin run code that only needs to be run once when the plugin is added to calibre
pdurrant is offline   Reply With Quote