19 Nov, 2008
Service-manager for KDE4 with COMAR and PyKDE4
Posted by: Gökmen Göksel In: English| KDE| Pardus| Programming| Python| Qt
These days we are working hard on Pardus KDE technologies for our next release “Pardus 2009″; within these tasks first job is porting (and redesigning) our *-manager family to KDE4.
We have a COnfiguration MAnageR called COMAR which uses D-Bus for communication. COMAR provides a powerful and extendible API for managing anything such as package, network, x.org, bootloader, disk or system service which are also described in model.xml.
From COMAR.Api.qt4 example:
import comar
# Create link
self.link = comar.Link()
def handler(package, exception, results):
# do something with these info..
print package, results
# Get all services from comar
link.System.Service.info(async=handler)
It will get you all services status and their info asynchronously to the handler method. Also if you want to start “openssh” service you can call it like;
link.System.Service["openssh"].start()
When you do this, COMAR will call the PolicyKit-KDE(3) and asks password if you have privileges for this action.(I will show it in action)
Yes, COM
is ready for the party .. 