From 791eae07a3cb34777980db94e56a9c29ef6ba836 Mon Sep 17 00:00:00 2001 From: yomguy <> Date: Mon, 26 Nov 2007 14:33:54 +0000 Subject: [PATCH] Fix web --- pre-barreau_courses.txt | 10 ++--- teleoddcast.py | 91 +++++++++++++++++++++++++++++------------ 2 files changed, 69 insertions(+), 32 deletions(-) diff --git a/pre-barreau_courses.txt b/pre-barreau_courses.txt index 870718e..3e96f67 100644 --- a/pre-barreau_courses.txt +++ b/pre-barreau_courses.txt @@ -1,6 +1,3 @@ -+--------------------------------------------------------- -| CRFPA -+--------------------------------------------------------- Liberté publiques - Cours Note de synthèse - Corrections Droit civil - Cours @@ -37,10 +34,11 @@ Procédure communautaire - Cours Procédures civile d'exécution - Cours Comptabilité privée - Cours Finances publiques - Cours +REUNION TEST -+--------------------------------------------------------- -| AE -+--------------------------------------------------------- + + + Administratif_Cours Adm_Correction Civil_Correction diff --git a/teleoddcast.py b/teleoddcast.py index 42a954e..388983d 100755 --- a/teleoddcast.py +++ b/teleoddcast.py @@ -53,16 +53,18 @@ class TeleOddCast(Course): def __init__(self, conf_file, course_dict): Course.__init__(self, course_dict) self.conf = xml2dict(conf_file) - self.title = self.conf['title'] - self.root_dir = self.conf['root_dir'] - self.media_dir = self.conf['media_dir'] - self.server = self.conf['server'] - self.port = self.conf['port'] - self.url = 'http://'+self.server+':'+self.port + self.conf = self.conf['teleoddcast'] + self.title = self.conf['infos']['name'] + self.root_dir = self.conf['server']['root_dir'] + self.media_dir = self.conf['media']['dir'] + self.host = self.conf['server']['host'] + self.port = self.conf['server']['port'] + self.password = self.conf['server']['sourcepassword'] + self.url = 'http://'+self.host+':'+self.port self.uid = os.getuid() self.odd_pid = get_pid('^oddcastv3 -n [^LIVE]', self.uid) self.rip_pid = get_pid('streamripper ' + self.url + self.mount_point, self.uid) - self.odd_conf_file = self.conf['odd_conf_file'] + self.odd_conf_file = self.conf['server']['odd_conf_file'] self.ServerDescription = clean_string('_-_'.join(self.title, self.department, self.course, @@ -78,7 +80,8 @@ class TeleOddCast(Course): clean_string(self.course)+'.ogg' self.lock_file = self.root_dir + self.ServerDescription + '.lock' self.filename = self.ServerDescription + '.ogg' - + + def set_oddcast_conf(self): oddconf = open(self.odd_conf_file,'r') lines = oddconf.readlines() @@ -94,7 +97,10 @@ class TeleOddCast(Course): elif 'ServerMountpoint' in line.split('='): newlines.append('ServerMountpoint=' + self.mount_point + '\n') - + + elif 'ServerPassword' in line.split('='): + newlines.append('ServerPassword=' + self.password + '\n') + else: newlines.append(line) @@ -183,8 +189,10 @@ class WebView: def __init__(self, school_file): self.conf = xml2dict(school_file) - self.departments = self.conf['department'] + self.conf = self.conf['teleoddcast'] self.url = self.conf['url'] + self.departments = self.conf['department']['name'] + self.len_departments = str(len(self.departments)) def header(self): # Required header that tells the browser how to render the HTML. @@ -193,6 +201,27 @@ class WebView: print "" print "\t"+self.title+"" print "" + print '' + print "" print "" print "
" @@ -214,23 +243,33 @@ class WebView: self.header() print "
" print "
Cliquez ici pour écouter le flux continu 24/24 en direct
" + print "\t" + print "\t\t" + print "\t\t" + + print "\t\t" + print "" + + print "\t\t" + print "" + + print "\t\t" + + print "\t\t" + + print "\t\t" + + print "\t
Titre :"+self.title+"
Département :" - print "\t\t" - print "\t\t" - print "\t\t" - print "\t\t" - print "\t\t" - print "\t\t" - print "\t\t" - print "\t
Titre :"+self.title+"
Département :"+department+"
Intitulé du cours :
Session :
Professeur :
Commentaire :
" + print "" + print "
Intitulé du cours :
Session :
Professeur :
Commentaire :
" print "\t
Attention, il est important de remplir tous les champs, y compris le commentaire !
" print "
" print "
" -- 2.39.5