"""
telecaster
- Copyright (c) 2006-2008 Guillaume Pellerin <yomguy@parisson.org>
+ Copyright (c) 2006-2010 Guillaume Pellerin <yomguy@parisson.org>
# This software is governed by the CeCILL license under French law and
# abiding by the rules of distribution of free software. You can use,
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)
self.main()
elif deefuzzer_pid == []:
- self.form.start_form(writing, casting)
+ form.start_form(writing, casting)
self.logger.write_info('stopped')
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"""
self.sub_header()
self.hardware_data()
- print "<form method=\"POST\" action=\"telecaster.py\" name=\"formulaire\">"
+ print "<form method=\"post\" action=\"telecaster.py\" name=\"formulaire\">"
print "<div class=\"main\">"
print "<table class=\"form\">"
print "<TR><TH align=\"left\">Titre</TH><TD> : </TD><TD>"+self.title+"</TD></TR>"
print "<TR><TH align=\"left\">Département</TH><TD> : </TD>"
print "<TD><select name=\"department\" onChange=\"choix(this.form)\">"
- print "<option selected=\"\">...........Choisissez un département...........</option>"
+ print "<option>...........Choisissez un département...........</option>"
for department in self.departments:
print "<option value=\""+department['name']+"\">"+department['name']+"</option>"
print "</select></TD></TR>"
print "<TR><TH align=\"left\">Conférence</TH><TD> : </TD>"
print "<TD><select name=\"conference\">"
- print "<option selected=\"\">...........Choisissez une conférence...........</option>"
+ print "<option>...........Choisissez une conférence...........</option>"
for i in range(1,self.conference_nb_max):
print "<option></option>"
print "</select></TD></TR>"
self.header()
self.sub_header()
-
- print "<form method=\"POST\" action=\"telecaster.py\" name=\"formulaire\">"
-
self.hardware_data()
print "<div class=\"main\">"
print "</table>"
print "</div>"
print "<div class=\"tools\">"
+ print "<form method=\"post\" action=\"telecaster.py\" name=\"formulaire\">"
print "<div class=\"buttons\">"
print "<button><img src=\"img/arrow_refresh.png\" alt=\"\">Refresh</button>"
print "<a href=\""+self.url+":"+self.port+"/"+self.mount_point+"\"><img src=\"img/control_play_blue.png\" alt=\"\">Play</a>"
print "<a href=\"http://"+self.url+"/archives/\"><img src=\"img/folder_go.png\" alt=\"\">Archives</a>"
print "<a href=\"http://"+self.url+"/trash/\"><img src=\"img/bin.png\" alt=\"\">Trash</a>"
print "</div>"
- print "</div>"
print "</form>"
+ print "</div>"
+
self.colophon()
self.footer()