diff vixm/playlist.py @ 9:eaa800169f5b v0.10

Hooked up the playlists to control xmms! Also added help string to all the commands, and added a stub for help command
author Josef "Jeff" Sipek <jeffpc@josefsipek.net>
date Sat, 19 Aug 2006 20:02:59 -0400
parents 79340745c952
children 50584a5c300e
line wrap: on
line diff
--- a/vixm/playlist.py	Sat Aug 19 19:41:06 2006 -0400
+++ b/vixm/playlist.py	Sat Aug 19 20:02:59 2006 -0400
@@ -20,7 +20,10 @@
 	
 	def pop(self):
 		""" Pop the next song """
-		return self.__list.pop(0)
+		try:
+			return self.__list.pop(0)
+		except IndexError:
+			return None
 
 	def __getitem__(self, i):
 		""" Get item at position i """
@@ -30,3 +33,7 @@
 		""" Return the length of the playlist """
 		return len(self.__list)
 
+	def index(self, song):
+		""" Returns the index of the first occurence of song """
+		return self.__list.index(song)
+