comparison vixm/main.py @ 46:2d570448aba5 pure

Abstract out the stats code a little bit more This is in preparation for moving the stats code completely out of player code
author Josef "Jeff" Sipek <jeffpc@josefsipek.net>
date Mon, 06 Nov 2006 05:19:23 -0500
parents 2bf81d95246a
children 1ae315a49009
comparison
equal deleted inserted replaced
45:2bf81d95246a 46:2d570448aba5
1 import time 1 import time
2 2
3 import playlist, song, player 3 import playlist, song, player
4 import ui as uimod 4 import ui as uimod
5 5
6 def run(filename): 6 def run(listfn, statsfn):
7 """ this is where we start execution """ 7 """ this is where we start execution """
8 8
9 # first, let's create the two playlists 9 # first, let's create the two playlists
10 print "Creating playlists..." 10 print "Creating playlists..."
11 lists = {} 11 lists = {}
14 14
15 # read in the info for all the songs in XMMS's playlist 15 # read in the info for all the songs in XMMS's playlist
16 print "Loading songs from XMMS's playlist..." 16 print "Loading songs from XMMS's playlist..."
17 songs = [] 17 songs = []
18 idx = 0 18 idx = 0
19 for l in open(filename, "r").readlines(): 19 for l in open(listfn, "r").readlines():
20 if l[0] == "#": 20 if l[0] == "#":
21 continue 21 continue
22 22
23 s = song.song(l[:-1], idx) 23 s = song.song(l[:-1], idx)
24 lists[playlist.LIST_DEFAULT].enqueue(s) 24 lists[playlist.LIST_DEFAULT].enqueue(s)