The __main__ stuff to allow the dialog to run under calibre-debug -c

This commit is contained in:
Charles Haley 2024-11-13 14:30:54 +00:00
parent 2b625a173e
commit c097c450c1

View File

@ -185,3 +185,15 @@ class FFDocEditor(Dialog):
def functions_box_index_changed(self, idx):
self.show_original_cb.setChecked(True)
self.fill_in_top_row()
if __name__ == '__main__':
from tempfile import TemporaryDirectory
from calibre.db.legacy import LibraryDatabase
from calibre.gui2 import Application
with TemporaryDirectory() as tdir:
app = Application([])
db = LibraryDatabase(tdir) # needed to load formatter_funcs
d = FFDocEditor(None)
d.exec()
del app