View Single Post
Old 03-08-2022, 12:04 PM   #62
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,509
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
FWIW: you can easily determine whether apply_state() has the save_state named parameter.
Code:
        import inspect
        x = inspect.signature(self.gui.library_view.apply_state)
        has_save_state = 'save_state' in x.parameters
inspect.signature() appeared in python 3 so this won't work on calibre 4 and earlier, so your exception method might be a better solution. Or directly checking the calibre version.
chaley is offline   Reply With Quote