View Single Post
Old 09-02-2017, 11:31 AM   #225
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,737
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Question How to add python3lib to sys.path

My simple epub2 output plugin uses ncxgenerator.py from the python3lib folder to optionally generate a new toc.ncx file from nav.xhtml.
(I know that the Python files in the python3lib folder are not intended for use with plugins, however, some of the functions might actually be helpful in special cases, such as my epub2 output plugin.)
Since I couldn't figure out a good cross-platform method for adding python3lib to sys.path, I simply bundled ncxgenerator.py with my plugin.
Even though I don't think that ncxgenerator.py will be significantly updated in future Sigil versions, I think that it'd be better to add python3lib to sys.path instead of bundling ncxgenerator.py with the plugin.

1. Would it be possible to add python3lib to sys.path in one of the next Sigil versions?

or

2. Is there a robust cross-platform method for adding python3lib to sys.path that I overlooked?
Doitsu is offline   Reply With Quote