]> git.parisson.com Git - telecaster-cgi.git/commitdiff
try to fix first refresh
authoryomguy <yomguy@parisson.com>
Fri, 19 Nov 2010 15:14:52 +0000 (15:14 +0000)
committeryomguy <yomguy@parisson.com>
Fri, 19 Nov 2010 15:14:52 +0000 (15:14 +0000)
conf/etc/telecaster/telecaster.xml
telecaster.py
webview.py

index d2efd885a193751a8d2bbd7737536c7e3d42f294..ed3e00e9d848cc8314d096f6e59562a1fad4ea3f 100644 (file)
@@ -2,7 +2,7 @@
     <infos>
         <short_name>Parisson</short_name>
         <name>Parisson</name>
-        <description>Parisson TeleCaster Services</description>
+        <description>TeleCaster Services</description>
         <url>telecaster.parisson.com</url>
         <genre>Various</genre>
     </infos>
index 4c9b654025e718ce47e913a05118afade89bf7eb..be6d374a21a84db42fa8716227d4c003e6bdb7bd 100755 (executable)
@@ -4,7 +4,7 @@
 """
    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,
@@ -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')
 
 
index 8a8d9f2c7fd205be790bdc97986a0b79df58918e..7e7057758cd589f3494651ebf45a587836691c8a 100644 (file)
 
 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 "<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&eacute;partement</TH><TD> : </TD>"
         print "<TD><select name=\"department\" onChange=\"choix(this.form)\">"
-        print "<option selected=\"\">...........Choisissez un d&eacute;partement...........</option>"
+        print "<option>...........Choisissez un d&eacute;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&eacute;rence</TH><TD> : </TD>"
         print "<TD><select name=\"conference\">"
-        print "<option selected=\"\">...........Choisissez une conf&eacute;rence...........</option>"
+        print "<option>...........Choisissez une conf&eacute;rence...........</option>"
         for i in range(1,self.conference_nb_max):
             print "<option></option>"
         print "</select></TD></TR>"
@@ -286,9 +286,6 @@ class WebView(FieldStorage):
 
         self.header()
         self.sub_header()
-
-        print "<form method=\"POST\" action=\"telecaster.py\" name=\"formulaire\">"
-
         self.hardware_data()
 
         print "<div class=\"main\">"
@@ -302,6 +299,7 @@ class WebView(FieldStorage):
         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>"
@@ -309,8 +307,9 @@ class WebView(FieldStorage):
         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()