comparison 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
comparison
equal deleted inserted replaced
8:79340745c952 9:eaa800169f5b
18 """ Remove a song from the list """ 18 """ Remove a song from the list """
19 self.__list.remove(song) 19 self.__list.remove(song)
20 20
21 def pop(self): 21 def pop(self):
22 """ Pop the next song """ 22 """ Pop the next song """
23 return self.__list.pop(0) 23 try:
24 return self.__list.pop(0)
25 except IndexError:
26 return None
24 27
25 def __getitem__(self, i): 28 def __getitem__(self, i):
26 """ Get item at position i """ 29 """ Get item at position i """
27 return self.__list[i] 30 return self.__list[i]
28 31
29 def __len__(self): 32 def __len__(self):
30 """ Return the length of the playlist """ 33 """ Return the length of the playlist """
31 return len(self.__list) 34 return len(self.__list)
32 35
36 def index(self, song):
37 """ Returns the index of the first occurence of song """
38 return self.__list.index(song)
39