From 1e81cb3d96ab973da7e8d2a32912550e6ca3f02d Mon Sep 17 00:00:00 2001 From: Greg Darke Date: Fri, 13 Mar 2009 20:38:13 +1100 Subject: [PATCH] Removing old kde (kdcop) interface. This does not work anymore, since KDE switched to dbus --- kde_randombg.py | 81 ------------------------------------------------- 1 file changed, 81 deletions(-) delete mode 100755 kde_randombg.py diff --git a/kde_randombg.py b/kde_randombg.py deleted file mode 100755 index 15de2c8..0000000 --- a/kde_randombg.py +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env python -# coding:utf-8 -# This is an example of a DCOP enabled application written in Python, using -# PyKDE and the dcopexport module. Taken from server.py example in kde-bindings -# which was written by Torben Weis and Julian Rockey - -import sys -import randombg2 -from kdecore import KApplication, KCmdLineArgs, KAboutData -from dcopexport import DCOPExObj -from qt import QString, QStringList - -# the class which will expose methods to DCOP - the methods do NOT -# need to be a member of this class. -class RandomBGIface (DCOPExObj): - def __init__ (self, id = 'RandomBGIface'): - DCOPExObj.__init__ (self, id) - - # the methods available from this app via DCOP - # addMethod (, ) - self.addMethod('QString getCurrentWallpaper()', self.getCurrent) - self.addMethod('void setCurrentWallpaper(QString)', self.changeTo) - self.addMethod('void cycleNextWallpaper()', self.cycleNext) - self.addMethod('void cyclePrevWallpaper()', self.cyclePrev) - self.addMethod('bool writeCache()', self.writeCache) - - self.filelist = randombg2.AllRandomFileList() - self.filelist.doAddPaths([ - # Add paths here - ]) - if not self.filelist.attemptCacheLoad(randombg2.CACHE_LOCATION): - self.filelist.doScanPaths() - self.randombg = randombg2.RandomBG(self.filelist) - - def getCurrent(self): - return self.filelist.getLastImage() - - def changeTo(self, wallpaper): - self.randombg._randombg(wallpaper) - - def cycleNext(self): - self.randombg.cycleNext() - - def cyclePrev(self): - self.randombg.cyclePrev() - - def writeCache(self): - if self.filelist.doStoreCache(randombg2.CACHE_LOCATION): - return True - else: - return False - -description = "A basic application template" -version = "1.0" -aboutData = KAboutData ("testdcopexport", "randombg",\ - version, description, KAboutData.License_GPL,\ - "(C) 2006 Greg Darke") - -aboutData.addAuthor ("James Bunton", "Origional Version", "jbun5313@usyd.edu.au") -aboutData.addAuthor ("Greg Darke", "Coded the WMaker/KDE backends, the persistent random lists, and general bug fixes", "gdar9540@usyd.edu.au") - -KCmdLineArgs.init (sys.argv, aboutData) - -KCmdLineArgs.addCmdLineOptions ([("+paths", "Paths to scan for images")]) - -MYAPPID = 'randombg' -app = KApplication() -dcop = app.dcopClient() -appid = str(dcop.registerAs(MYAPPID, False)) -if appid != MYAPPID: - print >>sys.stderr, 'Failed to get the applicationid of "%s", this means this program is already running' % MYAPPID - print 'Got "%s"' % appid - sys.exit(1) - -print "DCOP Application: %s starting" % appid - -randombgIface = RandomBGIface() - -app.exec_loop() - -randombgIface.filelist.doStoreCache(randombg2.CACHE_LOCATION) -- 2.39.2