View Single Post
Old 12-10-2017, 11:32 AM   #236
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,739
Karma: 24031403
Join Date: Dec 2010
Device: Kindle PW2
Expose the epub file name to Plugin API

Currently, it's pretty much impossible to get the name of currently opened file with Python. Some time ago, I investigated a rather complicated and not very reliable Windows-only method.

Since a Plugin Runner code update probably wouldn't be easy, I'm wondering about a different approach: would it be possible to have Sigil write the name of the epub file to the recentfile sigil.ini entry upon opening the epub file?
Plugin developers could then simply parse sigil.ini with configparser to get the file name. Since Sigil writes the file name to sigil.ini anyway whenever a file is closed this shouldn't require major code changes.
Doitsu is offline   Reply With Quote