Bug 209051 - Python-script-engine: Cannot subclass Plasma.Service
Summary: Python-script-engine: Cannot subclass Plasma.Service
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Unmaintained
Component: scriptengines (other bugs)
Version First Reported In: unspecified
Platform: Ubuntu Unspecified
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-01 01:25 UTC by nik
Modified: 2009-11-16 09:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nik 2009-10-01 01:25:46 UTC
Version:            (using KDE 4.3.1)
Installed from:    Ubuntu Packages

If I create a subclass of Plasma.Service and try to instantiate it I get a runtime exception:

TypeError: PyKDE4.plasma.Service cannot be instantiated or sub-classed

According to the api[1] it should be possible to subclass Plasma.Service.

----

- [1] http://api.kde.org/pykde-4.2-api/plasma/Plasma.Service.html
- My forum post about that bug:  http://forum.kde.org/viewtopic.php?f=64&t=82529
Comment 1 nik 2009-10-24 14:05:09 UTC
In the python-bindings Plasma.Service is marked as Abstract, Line 23 of [1]

The SIP reference-Guide [2] on "QObject /Abstract/": 
> This boolean annotation is used to specify that the class has additional pure 
> virtual methods that have not been specified and so it cannot be instantiated 
> or sub-classed from Python

I'd like to write a Dataengine that needs some additional parameters (see form-link in the initial report). 

Currently my Plasmoid [3] does downloading and parsing inside the gui-thread (because I cannot pass parameters to the Dataengine). This has some disadvantages for the users:

- the Plasma-Desktop hangs while downloading and parsing
- other plasmoids cannot reuse the functionality

I checked a lot of other (scripted)-plasmoids to see how they did it (e.g. retriving data from the internet, parse and display it). They all do it in the gui-thread (gmail-plasmoid ... ) which I think is wrong. 

How can this problem be solved? Maybe write another bug-report on Plasma that says: Service should implement the pure virtual functions (then it would not be abstract anymore and could be subclassed).


/nik

[1] http://websvn.kde.org/trunk/KDE/kdebindings/python/pykde4/sip/plasma/service.sip?view=markup 
[2]
http://doc.crossplatform.ru/python/sip/4.7.9/sipref.html#abstract
[3] http://www.kde-look.org/content/show.php/Nagios+Plasmoid?content=114057
Comment 2 Petri Damstén 2009-11-16 09:15:58 UTC
Allow the Plasma.Service class to be subclassed.

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