Bug 226351

Summary: Plasmate appends .js to Python mainscripts
Product: [Plasma] Plasma SDK Reporter: Luca Beltrame <lbeltrame>
Component: GeneralAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Unspecified   
Latest Commit: Version Fixed In:

Description Luca Beltrame 2010-02-11 18:23:38 UTC
Version:           0.1 alpha 1 (using KDE 4.4.0)
Installed from:    openSUSE RPMs

When creating a project for a Python applet (using the exact same code as the second Techbase tutorial), creating the main script file and then using the preview only results in a "Script initialization failed" error.

On console, this is the output that is significant:

plasmate(30683)/libplasma Plasma::AppletPrivate::mainConfigGroup: copying default config:  "/home/lb/.kde4/share/apps/plasmate/entrezsearcher/contents/config/default-configrc"
plasmate(30683)/libplasma Plasma::AppletPrivate::setupScriptSupport: setting up script support, package is in "/home/lb/.kde4/share/apps/plasmate/entrezsearcher/" which is a "Plasmoid" package , main script is "/home/lb/.kde4/share/apps/plasmate/entrezsearcher/contents/code/entrezsearcher.py.js"
Traceback (most recent call last):
  File "/usr/share/kde4/apps/plasma_scriptengine_python/pyappletscript.py", line 59, in init
    self.module = __import__(self.pluginName+'.'+relpath)
ImportError: No module named entrezsearcher.py.js

So that means that the .js suffix is being wrongly added here, and in the metadata.desktop file. Notice that the applet won't run even if this is fixed, but I'll investigate first (and report a separate bug if the case).
Comment 1 Aaron J. Seigo 2010-02-11 23:16:14 UTC
SVN commit 1088914 by aseigo:

* missing 'else'
* use KDesktopFile, not QFile, to write a desktop file
BUG:226351


 M  +10 -15    startpage.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1088914