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', ''))
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:
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.
except:
pass
return True
-
+
def create_station(self, folder, options):
"""Create a station definition for a folder given the specified options."""
# 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
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():
self._info('Restarted crashed station ' + i)
except:
pass
-
+
self.mainLoop = True
time.sleep(5)
# end main loop
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()
data = confile.read()
confile.close()
return json.loads(data)
-
+
return False
def folder_contains_music(folder):
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',