diff vixm/ui.py @ 6:50745af6a63b

Print song lengths in something better than number of milliseconds, added ":lists" command to list all the playlists
author Josef "Jeff" Sipek <jeffpc@josefsipek.net>
date Fri, 18 Aug 2006 20:32:00 -0400
parents 187453f856a7
children f87b969fa973
line wrap: on
line diff
--- a/vixm/ui.py	Fri Aug 18 20:26:11 2006 -0400
+++ b/vixm/ui.py	Fri Aug 18 20:32:00 2006 -0400
@@ -4,7 +4,7 @@
 from threading import Thread
 import xmms
 
-import playlist, song
+import playlist, song, util
 
 def run():
 	""" this is where we start execution """
@@ -41,7 +41,8 @@
 
 	def __enqueue(self, id):
 		s = self.lists[playlist.LIST_DEFAULT][id]
-		print "Enqueuing song: %d. %s (%d)" % (id, s["title"], s["time"])
+		print "Enqueuing song: %d. %s (%s)" % (id, s["title"],
+				util.strtime(s["time"]))
 		self.lists[playlist.LIST_PRIO].enqueue(s)
 
 	def __cmd(self, txt):
@@ -65,8 +66,12 @@
 				listid = playlist.LIST_PRIO
 
 			for s in self.lists[listid]:
-				print "%d. %s (%d)" % (i, s["title"], s["time"])
+				print "%d. %s (%s)" % (i, s["title"],
+						util.strtime(s["time"]))
 				i += 1
+		elif cmd == "lists":
+			print "#0 LIST_PRIO"
+			print "#1 LIST_DEFAULT"
 		else:
 			print "Invalid command \"%s\"" % (cmd,)