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