Hi All,
Python 3.4.X will be embedded directly into the upcoming Sigil binary and install. The vast majority of the Sigil code is C++ and will remain that way. That said, the use of Xerces for *pure* XML parsing (not xhtml as gumbo handles that) has been replaced with a python3/lxml/BeautifulSoup4 combination which is invoked via a dedicated C++/Python interface module.
So yes on Windows and Mac, Python 3 (with lxml/bs4 added) will be installed as part of Sigil to guarantee a workable Python3 version exists. It will be required for Sigil to properly function on those platforms.
We also plan to modify the Plugin Interface to see and use our own pre-installed Python3 automatically. Plugin users will still be able to select their own external Python 2 interpreter if they so desire. Plugins will continue to support both python 2 and python 3. The only advantage will be that Python3 will be guaranteed to be there and work (so no separate install required) for your plugin to work. This is why we spent time redesigning the plugin interface code and all support code to work on both Python 2 and Python 3 since we knew Python 3 was coming as part of a future install.
On Linux platforms, this is all moot anyway. Linux Packagers can decide to use their own Python 3.4 version with python 3 LXML and python 3 BS4 modules as required packages for Sigil just like they do now by requiring HunSpell, PCRE, mini-zip and other libraries as Sigil required packages. In fact, by removing Xerces and the associated (possibly non-free) files that were used for epub2 validation/flightcrew, we have made the Sigil code more "free" so that Debian and others who care about the exact license can package Sigil and include it with less worries.
So Sigil will always be a C++ program but python 3.X will be required to make everything work as expected and for some new feature development work. It just made no sense to re-invent the wheel and develop lots of C++ code to use libxml to replace Xerces for pure XML parsing when a Python 3.4 with lxml and BS4 would do everything we need and allow plugin developers to stop worrying about Windows users who were afraid to install any form of python (and we have all seen posts from them).
Hopefully, when the alpha is released, a user will be able to take a valid epub2 and use the epub3-itizer plugin to convert it to epub3 and then proceed to load the resulting epub3 and make codeview level changes with Sigil.
Eventually, special "internal" python3 plugins to autoconvert from epub2 to 3 (and possibly epub3 back to epub 2 if there is interest) will become part of a future Sigil 1.0 stable release alongside an epub3 metadata editing gui, auto creation of nav, and mathml appearing in Preview and BookView among other changes. That's the plan anyway.
Hope this explains things,
KevinH
|