[PATCH] Support for arbitrary main script names in Python plasmoids
Luca Beltrame
einar at heavensinferno.net
Thu Feb 11 19:02:37 CET 2010
Hello,
currently if you use Python plasmoids the main script *must* be named
"main.py" because it is hardcoded into pyappletscripts.py. When using a
different mainscript in the .desktop file (like Plasmate does) this will
ensure the plasmoid will not run (you get a NameError exception).
The attached patch fixes this by retrieving the mainscript file, stripping it
to its name and then using Python introspection (__dict__) to pass the right
module name to the CreateApplet call.
After applying, old plasmoids (using main.py) and new ones (using *any name*)
seem to work correctly.
OK to commit? Should this also be backported?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: python_scriptengine_mainscript.patch
Type: text/x-patch
Size: 844 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20100211/bd91ce82/attachment.patch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20100211/bd91ce82/attachment.sig
More information about the Plasma-devel
mailing list