コード例 #1
0
        def __select(self, query):
		r = Dcop.call("collection query \"SELECT %s\"" % query.replace('"', '\\"'))
		r = r.split("\n")
		nargs = len(query.split("FROM")[0].split(","))
		self.__results = [ ]
		while len(r) > 0:
			a = [ ]
			for i in range(nargs):
				a.append(r.pop(0))
			self.__results.append(a)
コード例 #2
0
        def __select(self, query):
		# FIXME: this needs to be converted to python-dcop, but I'm having some
		# encoding problems: it seems that query with non-ASCII characters just
		# don't work; see using-python-dcop branch
		# This is bug #105084
		# http://bugs.kde.org/show_bug.cgi?id=105084
		r = Dcop.call("collection query \"SELECT %s\"" % query.replace('"', '\\"'))
		r = r.split("\n")
		nargs = len(query.split("FROM")[0].split(","))
		self.__results = [ ]
		while len(r) > 0:
			a = [ ]
			for i in range(nargs):
				a.append(r.pop(0))
			self.__results.append(a)
コード例 #3
0
 def __init__(self, state):
     self.__running = True;
     self.__player = Player()
     self.__state = state
     Dcop.call("player enableRandomMode false")
コード例 #4
0
 def next(self):
     Dcop.call("player next")
コード例 #5
0
 def playMedia(self, url):
     Dcop.call("playlist playMedia \"%s\"" % url.encode('utf-8'))
コード例 #6
0
 def stop(self):
     self.updateStatus()
     if self.__status != self.Stopped:
         # Awful trick
         Dcop.call("player pause")
         Dcop.call("player stop")
コード例 #7
0
 def prev(self):
     Dcop.call("player prev")
コード例 #8
0
 def play(self):
     self.updateStatus()
     if self.__status != self.Playing:
         Dcop.call("player play")
コード例 #9
0
 def playPause(self):
     self.updateStatus()
     if self.__status != self.Stopped:
         Dcop.call("player playPause")
コード例 #10
0
 def updateStatus(self):
     self.__status = int(Dcop.call("player status"))
コード例 #11
0
 def index(self):
     return int(Dcop.call("playlist getActiveIndex"))
コード例 #12
0
 def update(self):
     return Dcop.call("playlist saveCurrentPlaylist")
コード例 #13
0
 def clear(self):
     Dcop.call("playlist clearPlaylist")
コード例 #14
0
 def __add(self, url):
     Dcop.call("playlist addMedia \"%s\"" % url)