Server=localhost
Port=8000
ServerPassword=source2parisson
-ServerMountpoint=/My_station_-_AE_-_REUNION.ogg
+ServerMountpoint=/My_station_-_CRFPA_-_Procédure_civile_-_Cours.ogg
ServerPublic=0
AutomaticReconnectSecs=10
Encode=OggVorbis
ExternalFile=/home/pre-barreau/augustins/audio/
#YP Settings
ServerStreamURL=http://www.pre-barreau.com
-ServerName=My_station_-_AE_-_REUNION_-_1
-ServerDescription=My_station_-_AE_-_REUNION_-_1_-_azd_-_azd
+ServerName=My_station_-_CRFPA_-_Procédure_civile_-_Cours_-_2
+ServerDescription=My_station_-_CRFPA_-_Procédure_civile_-_Cours_-_2_-_qgf_-_sdg
ServerGenre=Teaching
#Advanced Settings
LogLevel=1
import shutil
import datetime
import time
+import codecs
+import string
from tools import *
from mutagen.oggvorbis import OggVorbis
self.conf = xml2dict(school_file)
self.conf = self.conf['teleoddcast']
self.url = self.conf['url']
+ self.port = self.conf['port']
self.title = self.conf['title']
self.departments = self.conf['department']
#print self.departments
#print 'formulaire.course.options[j].value="";'
print 'else{'
print ' switch (i){'
- for k in range(0,self.len_departments):
+ for k in range(0, self.len_departments):
department = self.departments[k]
courses = department['courses']
#print courses
def start_form(self):
self.header()
print "<div id=\"main\">"
- print "<h5><a href=\"http://augustins.pre-barreau.com:8000/crfpa.pre-barreau.com_live.ogg.m3u\">Cliquez ici pour écouter le flux continu 24/24 en direct</a></h5>"
+ print "<h5><a href=\""+self.url+":"+self.port+"/crfpa.pre-barreau.com_live.ogg.m3u\">Cliquez ici pour écouter le flux continu 24/24 en direct</a></h5>"
print "\t<TABLE BORDER = 0>"
print "\t\t<form method=post action=\"teleoddcast.py\" name=\"formulaire\">"
print "\t\t<TR><TH align=\"left\">Titre :</TH><TD>"+self.title+"</TD></TR>"
print "\t\t<TR><TH align=\"left\">Commentaire :</TH><TD>"+comment+"</TD><TR>"
print "\t</TABLE>"
print "<hr>"
- print "<h5><a href=\""+self.url+"/"+clean_string(self.title)+"_-_"+clean_string(department)+"_-_"+clean_string(course)+".ogg.m3u\">Cliquez ici pour écouter cette formation en direct</a></h5>"
+ print "<h5><a href=\""+self.url+":"+self.port+"/"+clean_string(self.title)+"_-_"+clean_string(department)+"_-_"+clean_string(course)+".ogg.m3u\">Cliquez ici pour écouter cette formation en direct</a></h5>"
print "</div>"
print "<div id=\"tools\">"
print "\t<INPUT TYPE = hidden NAME = \"action\" VALUE = \"stop\">"
# Call main function.
conf_file = 'etc/teleoddcast.xml'
-school_file = 'etc/pre-barreau.xml'
+school_file = 'etc/localhost.xml'
if __name__ == '__main__':
t = TeleOddCast(conf_file, school_file)
import cgi
import shutil
import datetime
+import string
import time
from xmltodict import *
from mutagen.oggvorbis import OggVorbis
tup.append(value['name'])
return tup
+def dict2tuple_iso(dict):
+ len_dict = len(dict['course'])
+ if len_dict == 1:
+ return unicode(dict['course']['name'],'utf8').encode('iso-8859-1')
+ else:
+ tup = []
+ for value in dict['course']:
+ tup.append(unicode(value['name'],'utf8').encode('iso-8859-1'))
+ return tup
+
def get_course_from_lock(lock_file):
lockfile = open(lock_file,'r')
course = lockfile.readline()