watchfolder = {}
logqueue = Queue.Queue()
mainLoop = False
+ ignoreErrors = False
def __init__(self, conf_file):
Thread.__init__(self)
if key == 'm3u':
self.m3u = str(self.conf['deefuzzer'][key])
+ elif key == 'ignoreerrors':
+ # Load station definitions from the main config file
+ self.ignoreErrors = bool(self.conf['deefuzzer'][key])
+
elif key == 'station':
# Load station definitions from the main config file
if not isinstance(self.conf['deefuzzer'][key], list):
self._err('Error validating station ' + name)
except Exception:
self._err('Error starting station ' + name)
- raise
+ if not ignoreErrors:
+ raise
continue
ns = ns_new
self.channelIsOpen = True
return True
except:
- self.err('channel could not be opened')
-
+ self._err('channel could not be opened')
+
return False
def channel_close(self):
self.channel.set_metadata({'song': self.song, 'charset': 'utf-8'})
return True
except Exception, e:
- self_err('icecastloop_metadata: Error: ' + str(e))
+ self._err('icecastloop_metadata: Error: ' + str(e))
return False
def run(self):
<deefuzzer>
+ <!-- A quick note about XML configuration files - they cannot have empty values. For
+ example, <tag></tag> is invalid, while <tag> </tag> is valid (single space as a
+ value). An empty tag will crash the entire application. You have been warned. -->
<!-- A path to the log file (need write access rights to the directory) -->
<log>/path/to/station.log</log>
<!-- A path to the M3U playlist file (need write access rights to the directory).
The file is preferably accessible behind an url,
for example, http://mydomain.com/m3u/mystation.m3u -->
<m3u>/path/to/station.m3u</m3u>
+ <!-- Whether or not to skip stations that fail instead of dying completely. 0 will raise
+ all errors and report them to the console, 1 will log the error and continue. -->
+ <ignoreerrors>0</ignoreerrors>
<stationdefaults>
<!-- This tag allows a common default configuration to be set for all stations. This
is useful when defining many stations that will share many common configuration