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.