Talk:Paths/Developer/Creating plasmoids with scripts: Difference between revisions

From KDE TechBase
(Added note about obvious errors in the Python code)
 
No edit summary
Line 12: Line 12:
Cheers,
Cheers,
Sybren Stüvel -- sybren AT stuvel DOT eu
Sybren Stüvel -- sybren AT stuvel DOT eu
Actually it's not a c++ call, and you're right, @top is not python either. They're both ruby syntax. I've obviously been playing to much with ruby lately.

Revision as of 23:32, 17 January 2009

Errors in Python code

There are numerous errors in the Python script. Running it gives:

 File "main.py", line 14
   self.svg = Plasma::Svg.new(@top.applet())
                    ^
SyntaxError: invalid syntax

Which is of course quite obvious, since the :: is a C++ operator and not Pthon. The @top is also not Python syntax. Furthermore, the call to 'preparePainter' is done before the function itself is defined, which is also impossible.

Cheers, Sybren Stüvel -- sybren AT stuvel DOT eu


Actually it's not a c++ call, and you're right, @top is not python either. They're both ruby syntax. I've obviously been playing to much with ruby lately.