Okay, I grabbed a copy of all of our linked Plugins and ran checks on them to see what if anything they used from compatibility_utils.py and unipath.py
Here is what I found:
Code:
Archive: ACE_0.2.2.zip
.//ACE/plugin.py:from compatibility_utils import iswindows
Archive: AddiBooksXML_v0.1.0.zip
.//AddiBooksXML/plugin.py:from compatibility_utils import PY2, unicode_str
.//AddiBooksXML/utilities.py:from compatibility_utils import PY2
.//AddiBooksXML/plugin.py:from unipath import pathof
Archive: Borkify_0.2-plugin.zip
.//Borkify/epub_utils.py:from compatibility_utils import text_type, binary_type, utf8_str, unicode_str, bord, bchr
.//Borkify/epub_utils.py:import unipath
.//Borkify/epub_utils.py:from unipath import pathof
.//Borkify/epub_utils.py: files = unipath.walk(ebook_path)
Archive: KindleGen_v0.5.5.zip
.//KindleGen/mobi_split.py:from unipath import pathof
Archive: KindleImport_v0.82.1.zip
- Uses compatibility_utils and also internal version from kindleunpackcore
- Uses internal version of unipath from kindleunpackcore
.//KindleImport/gui_utilities.py:from compatibility_utils import PY2
.//KindleImport/gui_utilities.py:from compatibility_utils import unicode_str
.//KindleImport/mobi_stuff.py:from compatibility_utils import PY2, bstr
.//KindleImport/plugin.py:from compatibility_utils import PY2, unicode_str
.//KindleImport/quickepub.py:from kindleunpackcore.compatibility_utils import unicode_str
...
Archive: MarkdownImport_v0.1.2.zip
.//Markdown/plugin.py:from compatibility_utils import iswindows
Archive: ShadyCharacters_v0.1.1.zip
from compatibility_utils import PY2
Archive: ShowSemantics_v0.1.5.zip
from compatibility_utils import unquoteurl
Archive: SubsetFonts_v0.2.3.zip
.//SubsetFonts/plugin.py:from compatibility_utils import iswindows
Archive: TagMechanic_v0.4.4.zip
.//TagMechanic/plugin.py:from compatibility_utils import PY2
.//TagMechanic/dialogs.py:from compatibility_utils import PY2
Archive: icarus_v0.0.3.zip
-Uses both compatibility_utils and unipath but supplies their own
So it appears we can update the following plugins easily:
Archive: ACE_0.2.2.zip
Archive: MarkdownImport_v0.1.2.zip
Archive: SubsetFonts_v0.2.3.zip
by replacing:
from compatibility_utils import iswindows
with:
iswindows = sys.platform.startswith('win')
Similarly ...
We can update the following plugins easily:
Archive: ShadyCharacters_v0.1.1.zip
Archive: TagMechanic_v0.4.4.zip
by replacing:
from compatibility_utils import PY2
with:
PY2 = sys.version_info[0] == 2
And that would just leave the following plugins which we could update by just adding a copy of compatibility_utils.py and/or unipath.py to them, (although KindleImport could just be updated by importing both from kindleunpackcore since it already includes both.
Archive: AddiBooksXML_v0.1.0.zip
Archive: Borkify_0.2-plugin.zip
Archive: KindleGen_v0.5.5.zip
Archive: KindleImport_v0.82.1.zip
Archive: ShowSemantics_v0.1.5.zip
Alternatively, we could keep both unipath.py and compatibility_utils.py and strip them down to just the used functions: iswindows, PY2, unquoteurl, unicode_str, pathof, etc, but that would leave some python2.7 vestiges still around in Sigil.
Thoughts?
KevinH