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)
        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)
 def __init__(self, state):
     self.__running = True;
     self.__player = Player()
     self.__state = state
     Dcop.call("player enableRandomMode false")
Exemplo n.º 4
0
 def next(self):
     Dcop.call("player next")
Exemplo n.º 5
0
 def playMedia(self, url):
     Dcop.call("playlist playMedia \"%s\"" % url.encode('utf-8'))
Exemplo n.º 6
0
 def stop(self):
     self.updateStatus()
     if self.__status != self.Stopped:
         # Awful trick
         Dcop.call("player pause")
         Dcop.call("player stop")
Exemplo n.º 7
0
 def prev(self):
     Dcop.call("player prev")
Exemplo n.º 8
0
 def play(self):
     self.updateStatus()
     if self.__status != self.Playing:
         Dcop.call("player play")
Exemplo n.º 9
0
 def playPause(self):
     self.updateStatus()
     if self.__status != self.Stopped:
         Dcop.call("player playPause")
Exemplo n.º 10
0
 def updateStatus(self):
     self.__status = int(Dcop.call("player status"))
Exemplo n.º 11
0
 def index(self):
     return int(Dcop.call("playlist getActiveIndex"))
Exemplo n.º 12
0
 def update(self):
     return Dcop.call("playlist saveCurrentPlaylist")
Exemplo n.º 13
0
 def clear(self):
     Dcop.call("playlist clearPlaylist")
Exemplo n.º 14
0
 def __add(self, url):
     Dcop.call("playlist addMedia \"%s\"" % url)