comparison vixm/ui.py @ 15:ae3451bedeb6

Implemented playlist searching
author Josef "Jeff" Sipek <jeffpc@josefsipek.net>
date Sat, 19 Aug 2006 23:53:56 -0400
parents 2ecc611d198f
children 447b47ab396f
comparison
equal deleted inserted replaced
14:2ca1ce7cb338 15:ae3451bedeb6
202 print "Invalid argument/value" 202 print "Invalid argument/value"
203 return 203 return
204 204
205 print "Invalid command \"%s\"" % (txt,) 205 print "Invalid command \"%s\"" % (txt,)
206 206
207 def search(self, lid, regexp):
208 print "Seaching list %d for '%s':" % (lid, regexp)
209 for song in self.lists[lid].search(regexp):
210 idx = self.lists[lid].index(song)+1
211 print "%d. %s" % (idx, str(song))
212
207 def run(self): 213 def run(self):
208 while not self.shutdown: 214 while not self.shutdown:
209 tmp = sys.stdin.readline().strip() 215 tmp = sys.stdin.readline().strip()
210 216
211 if tmp.startswith("/"): 217 if tmp.startswith("/"):
212 # '/ABC' - searching 218 # '/ABC' - searching
213 print "Searching not yet implemented" 219 self.search(playlist.LIST_PRIO, tmp[1:])
220 self.search(playlist.LIST_DEFAULT, tmp[1:])
214 else: 221 else:
215 # 'ABC' - commands 222 # 'ABC' - commands
216 self.__cmd(tmp) 223 self.__cmd(tmp)
217 224