View Single Post
Old 07-07-2012, 02:24 PM   #50
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,731
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Well you've got a few choices. You don't "have" to have a class, you can just declare normalise at the module level (reduce the indentation) and then change your show_dialog so it just says:
Code:
    def show_dialog(self):
        from calibre_plugins.ag_normepub.main import normalise
        normalise()

def normalise():
Or if you still want to have a class, change PlugMain so it doesn't inherit from QDialog:
Code:
    def show_dialog(self):
        plug = PlugMain()
        plug.normalise()

class PlugMain(object):
    def normalise(self):
I'm assuming in the above you don't need any of the gui related parameters, if you do just have a briefer constructor.
kiwidude is offline   Reply With Quote