View Single Post
Old 12-29-2015, 08:33 AM   #71
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Toxaris View Post
Perhaps a side effect from the update checker?
The update checker code segment is only executed once the plugin runs. I.e. it has nothing to do with Sigil itself. However, if a plugin corrupts/deletes its own plugin.xml file, it might no longer be listed.
The ePubCheck plugin checks its version number using xml.etree.ElementTree, but doesn't write to plugin.xml. I.e., it shouldn't have the capability to modify its plugin.xml file.

@KevinH & DiapDealer: Could you please do a "mini code review" of the following version checking segment?

Code:
import xml.etree.ElementTree as ET

    # run plugin version check
    plugin_xml_path = os.path.abspath(os.path.join(bk._w.plugin_dir, 'EpubCheck', 'plugin.xml'))
    plugin_version = ET.parse(plugin_xml_path).find('.//version').text
This is the only code that accesses plugin.xml and the ElementTree information isn't used elsewhere in the plugin.

In addition to the version check code I also added the following line to plugin.xml:

Code:
<autostart>true</autostart>
However, this line should be ignored by Sigil 0.9.2 and older versions.
Doitsu is offline   Reply With Quote