Plasmoid in Python erstellen

Python und das Qt-Toolkit, erstellen von GUIs mittels des Qt-Designers.
Antworten
hans
User
Beiträge: 728
Registriert: Sonntag 22. September 2002, 08:32
Wohnort: Sauerland
Kontaktdaten:

Versuche krampfhaft ein Plasmoid in Python zu erstellen. Arbeite nach diesem Tutorial https://techbase.kde.org/Development/Tu ... ingStarted

Installiert sind folgende Packages :

Code: Alles auswählen

Fedora23
pykde4
PyQt4
kf5-plasma  KDE Frameworks 5 Tier 3 framework is foundation to build a primary user interface.
qt5-qtbase
Parallel zu python 2.7.11 ist Python 3.4.3 installiert. Meine metadata.desktop sieht so aus

Code: Alles auswählen

[Desktop Entry]
Encoding=UTF-8
Name=Hello Python
Name[nl]=Hallo Python
Name[de]=Hallo Python
Type=Service
ServiceTypes=Plasma/Applet
Icon=chronometer
X-Plasma-API=python
X-Plasma-MainScript=code/main.py
X-KDE-PluginInfo-Author=Simon Edwards
X-KDE-PluginInfo-Email=simon@simonzone.com
X-KDE-PluginInfo-Name=hello-python
X-KDE-PluginInfo-Version=1.0
X-KDE-PluginInfo-Website=http://plasma.kde.org/
X-KDE-PluginInfo-Category=Examples
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true
Fehlt noch die main.py

Code: Alles auswählen

# -*- coding: utf-8 -*-
# <Copyright and license information goes here.>
from PyQt4.QtCore import Qt
from PyKDE4.plasma import Plasma
from PyKDE4 import plasmascript

class HelloPython(plasmascript.Applet):
    def __init__(self,parent,args=None):
        plasmascript.Applet.__init__(self,parent)

    def init(self):
        self.setHasConfigurationInterface(False)
        self.resize(125, 125)
        self.setAspectRatioMode(Plasma.Square)

    def paintInterface(self, painter, option, rect):
        painter.save()
        painter.setPen(Qt.white)
        painter.drawText(rect, Qt.AlignVCenter | Qt.AlignHCenter, "Hello Python!")
        painter.restore()

def CreateApplet(parent):
    return HelloPython(parent)
Beim Versuch das Plasmoid zu installieren kommt dann folgende Fehlermeldung:

Code: Alles auswählen

[nor@localhost spielwiese]$ kdebugdialog --fullmode
[nor@localhost spielwiese]$ plasmapkg -i hello-python.zip
plasmapkg(10837)/libplasma Plasma::Package::installPackage: ************************** 1
plasmapkg(10837)/libplasma Plasma::Package::installPackage: ************************** 2
plasmapkg(10837)/libplasma Plasma::Package::installPackage: ************************** 3
plasmapkg(10837)/libplasma Plasma::Package::installPackage: ************************** 4
plasmapkg(10837)/libplasma Plasma::Package::installPackage: ************************** 5
plasmapkg(10837)/libplasma Plasma::Package::installPackage: Could not register package as service (this is not necessarily fatal): "plasma-applet-hello-python" 
plasmapkg(10837)/libplasma Plasma::Package::installPackage: ************************** 7
Erfolgreich installiert: /home/nor/projects/spielwiese/hello-python.zip
Hat jemand eine Idee, wo das Problem liegen könnte? Google ist bei der Fehlermeldung leider wenig auskunftsfreudig
Antworten