From: yomguy <> Date: Fri, 19 Nov 2010 15:14:52 +0000 (+0000) Subject: try to fix first refresh X-Git-Tag: 0.9~184 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=04be3c42114ca98f57a296542446b07499b400e2;p=telecaster-client.git try to fix first refresh --- diff --git a/conf/etc/telecaster/telecaster.xml b/conf/etc/telecaster/telecaster.xml index d2efd88..ed3e00e 100644 --- a/conf/etc/telecaster/telecaster.xml +++ b/conf/etc/telecaster/telecaster.xml @@ -2,7 +2,7 @@ Parisson Parisson - Parisson TeleCaster Services + TeleCaster Services telecaster.parisson.com Various diff --git a/telecaster.py b/telecaster.py index 4c9b654..be6d374 100755 --- a/telecaster.py +++ b/telecaster.py @@ -4,7 +4,7 @@ """ telecaster - Copyright (c) 2006-2008 Guillaume Pellerin + Copyright (c) 2006-2010 Guillaume Pellerin # This software is governed by the CeCILL license under French law and # abiding by the rules of distribution of free software. You can use, @@ -87,37 +87,33 @@ class TeleCaster: deefuzzer_pid = get_pid('/usr/bin/deefuzzer '+self.user_dir+os.sep+'deefuzzer.xml', self.uid) writing = edcast_pid != [] casting = deefuzzer_pid != [] - self.form = WebView(self.conf, version) + form = WebView(self.conf, version) - if deefuzzer_pid == [] and self.form.has_key("action") and \ - self.form.has_key("department") and self.form.has_key("conference") and \ - self.form.has_key("professor") and self.form.has_key("comment") and \ - self.form["action"].value == "start": + if deefuzzer_pid == [] and form.has_key("action") and \ + form.has_key("department") and form.has_key("conference") and \ + form.has_key("professor") and form.has_key("comment") and \ + form["action"].value == "start": self.conference_dict = {'title': self.title, - 'department': self.form.getfirst("department"), - 'conference': self.form.getfirst("conference"), - 'session': self.form.getfirst("session"), - 'professor': self.form.getfirst("professor"), - 'comment': self.form.getfirst("comment")} - - #self.form = 0 - #print "Content-Type: text/html\n\n" - #print self.transition_head() + 'department': form.getfirst("department"), + 'conference': form.getfirst("conference"), + 'session': form.getfirst("session"), + 'professor': form.getfirst("professor"), + 'comment': form.getfirst("comment")} + s = Station(self.conf_file, self.conference_dict, self.lock_file) s.start() time.sleep(1) - #print self.transition_foot() self.logger.write_info('starting') - self.form.stop_form(self.conference_dict, writing, casting) - #self.main() +# form.stop_form(self.conference_dict, writing, casting) + self.main() - elif deefuzzer_pid != [] and os.path.exists(self.lock_file) and not self.form.has_key("action"): + elif deefuzzer_pid != [] and os.path.exists(self.lock_file) and not form.has_key("action"): self.conference_dict = get_conference_from_lock(self.lock_file) - self.form.stop_form(self.conference_dict, writing, casting) + form.stop_form(self.conference_dict, writing, casting) self.logger.write_info('started') - elif deefuzzer_pid and self.form.has_key("action") and self.form["action"].value == "stop": + elif deefuzzer_pid and form.has_key("action") and form["action"].value == "stop": if os.path.exists(self.lock_file): self.conference_dict = get_conference_from_lock(self.lock_file) s = Station(self.conf_file, self.conference_dict, self.lock_file) @@ -127,7 +123,7 @@ class TeleCaster: self.main() elif deefuzzer_pid == []: - self.form.start_form(writing, casting) + form.start_form(writing, casting) self.logger.write_info('stopped') diff --git a/webview.py b/webview.py index 8a8d9f2..7e70577 100644 --- a/webview.py +++ b/webview.py @@ -37,13 +37,13 @@ import os import cgi -#import cgitb import datetime import time import string +import cgitb from tools import * from cgi import FieldStorage -#cgitb.enable() +cgitb.enable() class WebView(FieldStorage): """Gives the web CGI frontend""" @@ -235,19 +235,19 @@ class WebView(FieldStorage): self.sub_header() self.hardware_data() - print "" + print "" print "" print "" print "Titre : "+self.title+"" print "Département : " print "" - print "...........Choisissez un département..........." + print "...........Choisissez un département..........." for department in self.departments: print ""+department['name']+"" print "" print "Conférence : " print "" - print "...........Choisissez une conférence..........." + print "...........Choisissez une conférence..........." for i in range(1,self.conference_nb_max): print "" print "" @@ -286,9 +286,6 @@ class WebView(FieldStorage): self.header() self.sub_header() - - print "" - self.hardware_data() print "" @@ -302,6 +299,7 @@ class WebView(FieldStorage): print "" print "" print "" + print "" print "" print "Refresh" print "Play" @@ -309,8 +307,9 @@ class WebView(FieldStorage): print "Archives" print "Trash" print "" - print "" print "" + print "" + self.colophon() self.footer()