]> git.parisson.com Git - deefuzzer.git/commitdiff
Cleaned infos
authorGuillaume Pellerin <yomguy@parisson.com>
Mon, 10 Sep 2007 08:00:23 +0000 (08:00 +0000)
committerGuillaume Pellerin <yomguy@parisson.com>
Mon, 10 Sep 2007 08:00:23 +0000 (08:00 +0000)
d-fuzz.py

index d9ed714353df6650eb8f012c2fc50e4dad74e63b..c987ff30e2db1d3306ebacf5669add62d93869ef 100755 (executable)
--- 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 <pellerin@parisson.com>
+        desc = '\n d-fuzz : easy and light streaming tool\n'
+        version = ' version : ' + self.version +'\n\n'
+        info = """ Copyright (c) 2007-2007 Guillaume Pellerin <pellerin@parisson.com>
  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)