From 2e768f1d9af666f91d71da1ab30ea2097eb8fd38 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 10 Sep 2007 08:00:23 +0000 Subject: [PATCH] Cleaned infos --- d-fuzz.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/d-fuzz.py b/d-fuzz.py index d9ed714..c987ff3 100755 --- a/d-fuzz.py +++ b/d-fuzz.py @@ -40,18 +40,17 @@ class DFuzz: """A D-Fuzz station""" def __init__(self): - - self.work_dir = os.environ['HOME']+'.d-fuzz' + + self.version = '0.1' self.conf = [] self.id = 999999 self.buffer_size = 0xFFFF self.rand_list = [] def prog_info(self): - return """ - d-fuzz : easy and light streaming tool - - Copyright (c) 2007-2007 Guillaume Pellerin + desc = '\n d-fuzz : easy and light streaming tool\n' + version = ' version : ' + self.version +'\n\n' + info = """ Copyright (c) 2007-2007 Guillaume Pellerin All rights reserved. This software is licensed as described in the file COPYING, which @@ -68,6 +67,8 @@ class DFuzz: see http://parisson.com/d-fuzz/ for more details """ + text = desc + version + info + return text def get_conf_dict(self): confile = open(self.conf_file,'r') @@ -101,12 +102,12 @@ class DFuzz: lp = len(playlist) self.rand_list = range(0,lp) random.shuffle(self.rand_list) - print self.rand_list + #print self.rand_list self.id = 0 else: self.id = self.id + 1 index = self.rand_list[self.id] - print str(self.id) +':'+ str(index) + #print str(self.id) +':'+ str(index) return playlist, playlist[index] def core_process(self, command, buffer_size): @@ -136,13 +137,16 @@ class DFuzz: yield __chunk def stream(self, conf_file): + + print "D-fuzz v"+self.version + self.conf_file = conf_file self.get_conf_dict() #for station in conf_dict['station']: station = self.conf['station'] - print station + #print station s = shout.Shout() print "Using libshout version %s" % shout.version() @@ -172,7 +176,6 @@ class DFuzz: # (keys are shout.SHOUT_AI_BITRATE, shout.SHOUT_AI_SAMPLERATE, # shout.SHOUT_AI_CHANNELS, shout.SHOUT_AI_QUALITY) - command = 'cat ' playlist = self.get_playlist() lp = len(playlist) print 'Playlist :' @@ -190,7 +193,7 @@ class DFuzz: playlist, media = self.get_next_media_lin(playlist) file_name = string.replace(media, self.media_dir + os.sep, '') - print 'Streaming file : %s' % file_name + print 'D-fuzz file : %s' % file_name s.set_metadata({'song': file_name}) command = 'cat "%s"' % media stream = self.core_process(command, self.buffer_size) -- 2.39.5