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
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
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)
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