while True:
k = i.next()
v = i.next()
- d[k] = v
+ d[str(k)] = v
except StopIteration:
pass
return d
home = pw.pw_dir
privconf = _configfile + "." + pw.pw_name
passfile = home + os.sep + ".disorder" + os.sep + "passwd"
- self._readfile(_configfile)
+ if os.path.exists(_configfile):
+ self._readfile(_configfile)
if os.path.exists(privconf):
self._readfile(privconf)
if os.path.exists(passfile) and _userconf:
Arguments:
track -- the path of the track to play.
+
+ Returns the ID of the new queue entry.
"""
- self._simple("play", track)
+ res, details = self._simple("play", track)
+ return unicode(details) # because it's unicode in queue() output
def remove(self, track):
"""Remove a track from the queue.
self._simple("search", _quote(words))
return self._body()
+ def tags(self):
+ """List all tags
+
+ The return value is a list of all tags which apply to at least one
+ track."""
+ self._simple("tags")
+ return self._body()
+
def stats(self):
"""Get server statistics.
ret, details = self._simple("move", track, str(delta))
return int(details)
+ def moveafter(self, target, tracks):
+ """Move a track in the queue
+
+ Arguments:
+ target -- target ID or None
+ tracks -- a list of IDs to move
+
+ If target is '' or is not in the queue then the tracks are moved to
+ the head of the queue.
+
+ Otherwise the tracks are moved to just after the target."""
+ if target is None:
+ target = ''
+ self._simple("moveafter", target, *tracks)
+
def log(self, callback):
"""Read event log entries as they happen.