]> git.parisson.com Git - deefuzzer.git/commitdiff
Goto 0.7
authorGuillaume Pellerin <yomguy@parisson.com>
Mon, 8 Dec 2014 15:05:31 +0000 (16:05 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Mon, 8 Dec 2014 15:05:31 +0000 (16:05 +0100)
Partially fixes #20 (bad chars on the icecast side...)

deefuzzer/__init__.py
deefuzzer/core.py
deefuzzer/station.py
deefuzzer/tools/utils.py
setup.py

index e1854b7534e76d4d985e1044b7a8ec85c2405d61..91d8d305bebd947de8dc2e106730345cacc770a7 100644 (file)
@@ -2,4 +2,4 @@ from core import *
 from station import *
 from tools import *
 
-__version__ = '0.6.6'
\ No newline at end of file
+__version__ = '0.7'
\ No newline at end of file
index 9c7c37dcd923e28facf40d26f31dff07a99b4c74..6ffaeb39c0dca4e50d0d569c7fbb97fb918cd95b 100644 (file)
@@ -67,7 +67,7 @@ class DeeFuzzer(Thread):
         self.conf = get_conf_dict(self.conf_file)
 
         if not 'deefuzzer' in self.conf.keys():
-            return 
+            return
 
         # Get the log setting first (if possible)
         log_file = str(self.conf['deefuzzer'].pop('log', ''))
@@ -114,13 +114,13 @@ class DeeFuzzer(Thread):
             self.logqueue.put(obj)
         except:
             pass
-    
+
     def _info(self, msg):
         self._log('info', msg)
-    
+
     def _err(self, msg):
         self._log('err', msg)
-    
+
     def set_m3u_playlist(self):
         m3u_dir = os.sep.join(self.m3u.split(os.sep)[:-1])
         if not os.path.exists(m3u_dir) and m3u_dir:
@@ -146,11 +146,11 @@ class DeeFuzzer(Thread):
             if not 'livecreation' in options.keys():
                 # We have no folder specified.  Bail.
                 return
-            
+
             if int(options['livecreation']) == 0:
                 # Livecreation not specified.  Bail.
                 return
-            
+
         folder = str(options['folder'])
         if not os.path.isdir(folder):
             # The specified path is not a folder.  Bail.
@@ -179,7 +179,7 @@ class DeeFuzzer(Thread):
         except:
             pass
         return True
-        
+
     def create_station(self, folder, options):
         """Create a station definition for a folder given the specified options."""
 
@@ -210,7 +210,7 @@ class DeeFuzzer(Thread):
             # We have a file specified.  Load just that file.
             self.load_station_config(folder)
             return
-            
+
         if not os.path.isdir(folder):
             # Whatever we have, it's not either a file or folder.  Bail.
             return
@@ -287,12 +287,14 @@ class DeeFuzzer(Thread):
                             self._err('Error validating station ' + name)
                     except Exception:
                         self._err('Error starting station ' + name)
+                        raise
                         continue
+
                 ns = ns_new
 
                 if self.m3u:
                     self.set_m3u_playlist()
-            
+
             for i in self.station_instances.keys():
                 try:
                     if not self.station_instances[i].isAlive():
@@ -300,7 +302,7 @@ class DeeFuzzer(Thread):
                         self._info('Restarted crashed station ' + i)
                 except:
                     pass
-            
+
             self.mainLoop = True
             time.sleep(5)
             # end main loop
index a3eda3c90c5246c9fd020e7e4d8c6bd3a5a9fc6e..ed87d17a1eba642593dcbc89036df47dfb689b1f 100644 (file)
@@ -760,7 +760,7 @@ class Station(Thread):
 
             return True
         except Exception, e:
-            self_err('icecastloop_nextmedia: Error: ' + str(e))
+            self._err('icecastloop_nextmedia: Error: ' + str(e))
         return False
 
     def icecastloop_metadata(self):
index f8d4072d1c1e89c4de4ae1c504060123353c67f7..43886cf35ae71b4effc44313394dcf24ff69618f 100644 (file)
@@ -87,6 +87,9 @@ def get_conf_dict(file):
         return xmltodict(data,'utf-8')
     elif 'yaml' in mime_type:
         import yaml
+        def custom_str_constructor(loader, node):
+            return loader.construct_scalar(node).encode('utf-8')
+        yaml.add_constructor(u'tag:yaml.org,2002:str', custom_str_constructor)
         confile = open(file,'r')
         data = confile.read()
         confile.close()
@@ -97,7 +100,7 @@ def get_conf_dict(file):
         data = confile.read()
         confile.close()
         return json.loads(data)
-    
+
     return False
 
 def folder_contains_music(folder):
index 0d3c0eca310d470c7fd8800e441080303a37491c..56cccad48989f1329ffcc9a648c4ce8d05791c5e 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -17,7 +17,7 @@ setup(
   long_description = open('README.rst').read(),
   author = "Guillaume Pellerin",
   author_email = "yomguy@parisson.com",
-  version = '0.6.6',
+  version = '0.7',
   install_requires = [
         'setuptools',
         'python-shout',