In data giovedì 11 febbraio 2010 19:37:55, Richard Dale ha scritto: > __dict__, but simply derives the main class name from the main script > name. So I wasn't sure is you should specifiy a main *class* name in
This is what is done with my change, at the moment (I used __dict__ because I thought it was the best solution - suggestions welcome in case as I'm not that experienced). Earlier, the main script name was forced to be called "main" or it would cause errors. > For Python, what if there are several classes in the the python main > script file - how do you tell which one is for the applet you want to > instantiate? You use the one that's called by CreateApplet, which needs to be put in the main script file: class FooApplet(plasmascript.Applet): ... def CreateApplet(parent): return FooApplet(parent) and the relevant bit is then called in the initialization: self.pyapplet = self.module.__dict__[basename].CreateApplet(None) so CreateApplet should *always* return the right applet and must be in the main script file.
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel