[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/generic/scriptengines/python
From:       Luca Beltrame <einar () heavensinferno ! net>
Date:       2010-03-03 21:21:36
Message-ID: 1267651296.051357.25996.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1098535 by lbeltrame:

Apply the applet script fix to runners, i.e. use __dict__ to call up main scripts \
that have different names than "main"


 M  +3 -1      pyrunner.py  


--- trunk/KDE/kdebase/workspace/plasma/generic/scriptengines/python/pyrunner.py \
#1098534:1098535 @@ -47,7 +47,9 @@
             relpath = relpath[:-3]
         relpath = relpath.replace("/",".")
         self.module = __import__(self.pluginName+'.'+relpath)
-        self.pyrunner = self.module.main.CreateRunner(None)
+        basename = os.path.basename(str(self.mainScript()))
+        basename = os.path.splitext(basename)[0]
+        self.pyrunner = self.module.__dict__[basename].CreateRunner(None)
         self.pyrunner.setRunner(self.runner())
         self.pyrunner.setRunnerScript(self)
         self.connect(self, SIGNAL('prepare()'), self, SLOT('prepare()'))


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic