-TELECASTER
-==========
+===================
+README - TELECASTER
+===================
LICENCE
=======
# Author: Guillaume Pellerin <yomguy@parisson.com>
+
ARCHITECTURE
============
Builds well on Debian GNU/Linux 5.0.4
+
DEPENDS
========
-required : python, icecast2, jackd, edcast-jack (=3.1.7), vorbis-tools, python-mutagen, streamrippper, procps
+required : python, icecast2, apache2, jackd, edcast-jack (=3.1.7), vorbis-tools,
+ python-mutagen, streamrippper, procps
+
optional : lame
+
MORE INFOS
==========
+
See http://svn.parisson.org/telecaster/
--- /dev/null
+<deefuzzer>
+ <log>/var/log/deefuzzer/deefuzzer.log</log>
+ <m3u>/var/www/m3u/deefuzzer.m3u</m3u>
+ <station>
+ <infos>
+ <short_name>TeleCaster</short_name>
+ <name>TeleCaster Live Session</name>
+ <description>LIVE Talk and Music</description>
+ <url>http://parisson.com</url>
+ <genre>Various Funk Groove</genre>
+ </infos>
+ <server>
+ <host>parisson.com</host>
+ <port>8000</port>
+ <sourcepassword>source2parisson</sourcepassword>
+ <public>0</public>
+ </server>
+ <media>
+ <dir>/path/to/mp3/</dir>
+ <format>mp3</format>
+ <bitrate>192</bitrate>
+ <ogg_quality>7</ogg_quality>
+ <samplerate>44100</samplerate>
+ <voices>1</voices>
+ <shuffle>1</shuffle>
+ </media>
+ <rss>
+ <dir>/var/www/rss/</dir>
+ <enclosure>1</enclosure>
+ </rss>
+ <twitter>
+ <mode>0</mode>
+ <user>my_twitter_user</user>
+ <pass>my_twitter_password</pass>
+ <tags>bla bla</tags>
+ </twitter>
+ <jingles>
+ <mode>0</mode>
+ <dir>/path/to/jingles</dir>
+ <shuffle>1</shuffle>
+ </jingles>
+ <control>
+ <mode>0</mode>
+ <port>1234</port>
+ </control>
+ <relay>
+ <mode>0</mode>
+ <url>http://localhost:8000/telecaster_live.mp3</url>
+ </relay>
+ <record>
+ <mode>0</mode>
+ <dir>/path/to/archives</dir>
+ </record>
+ </station>
+</deefuzzer>
+
+
<short_name>Pre-Barreau</short_name>
<name>Pre-Barreau</name>
<description>La preparation au Barreau de Paris</description>
- <url>http:///telecaster-04.parisson.com</url>
+ <url>http://telecaster-04.parisson.com</url>
<genre>Other</genre>
</infos>
<server>
- <host>localhost</host>
+ <host>stream.pre-barreau.com</host>
<port>8000</port>
<sourcepassword>source2parisson</sourcepassword>
<public>0</public>
<root_dir>/var/www/telecaster/</root_dir>
- <odd_conf_file>/etc/telecaster/telecaster_edcast_mp3.cfg</odd_conf_file>
- <lock_file>lock/telecaster.lock</lock_file>
- <rsync_host>localhost/tmp/</rsync_host>
<rss>
<dir>/var/www/rss/</dir>
</rss>
</server>
<media>
<record>true</record>
- <dir>/home/pre-barreau/media</dir>
- <raw_dir>/home/pre-barreau/backup</raw_dir>
+ <dir>/home/prebarreau/media</dir>
<format>mp3</format>
- <bitrate>96</bitrate>
+ <bitrate>48</bitrate>
<channels>1</channels>
<ogg_quality>3</ogg_quality>
- <samplerate>44100</samplerate>
+ <samplerate>48000</samplerate>
</media>
<jack>
<input>
#!/usr/bin/env python
+# -*- coding: utf-8 -*-
# Easily import simple XML data to Python dictionary
# http://www.gmta.info/publications/parsing-simple-xml-structure-to-a-python-dictionary
import xml.dom.minidom
+import xml.dom.ext
+from xml.sax.saxutils import escape
+
def haschilds(dom):
# Checks whether an element has any childs
return True
return False
+
def indexchilds(dom, enc):
childsdict = dict()
for childnode in dom.childNodes:
childsdict[name] = v
return childsdict
+
def xmltodict(data, enc=None):
dom = xml.dom.minidom.parseString(data.strip())
return indexchilds(dom, enc)
+def dicttoxml(d):
+
+ def unicodify(o):
+ if o is None:
+ return u'';
+ return unicode(o)
+
+ lines = []
+ def addDict(node, offset):
+ for name, value in node.iteritems():
+ if isinstance(value, dict):
+ lines.append(offset + u"<%s>" % name)
+ addDict(value, offset + u" " * 4)
+ lines.append(offset + u"</%s>" % name)
+ elif isinstance(value, list):
+ for item in value:
+ if isinstance(item, dict):
+ lines.append(offset + u"<%s>" % name)
+ addDict(item, offset + u" " * 4)
+ lines.append(offset + u"</%s>" % name)
+ else:
+ lines.append(offset + u"<%s>%s</%s>" % (name, escape(unicodify(item)), name))
+ else:
+ lines.append(offset + u"<%s>%s</%s>" % (name, escape(unicodify(value)), name))
+
+ addDict(d, u"")
+ lines.append(u"")
+ return u"\n".join(lines)
+