]> git.parisson.com Git - telecaster-server.git/commitdiff
* Creates raw_dir
authoryomguy <>
Fri, 25 Jul 2008 00:07:21 +0000 (00:07 +0000)
committeryomguy <>
Fri, 25 Jul 2008 00:07:21 +0000 (00:07 +0000)
* Clean CGI

etc/pre-barreau_conferences.xml
etc/telecaster_mp3.cfg
telecaster.py

index fdc49553cc4963eb54961b09ba64b060c08bcf9e..3753025c9bd2f35cb96194ee12918be5836225c9 100644 (file)
@@ -1,5 +1,5 @@
 <telecaster>
-    <url>http://192.168.7.202</url>
+    <url>http://localhost</url>
     <title>Pre-Barreau - ICP</title>
     <port>8000</port>
     <format>mp3</format>
index ed72e65b0ec5e16b5398d73df47b2abd9233dcb6..9aac5d7c41ef05192a5aa3cc86277735f0a8a4fd 100644 (file)
@@ -1,7 +1,7 @@
 Server=localhost
 Port=8000
 ServerPassword=source2parisson
-ServerMountpoint=/Pre-Barreau_-_ICP_-_CRFPA_-_Droit_administratif_Corrections.mp3
+ServerMountpoint=/Pre-Barreau_-_ICP_-_ENM_-_undefined.mp3
 ServerPublic=0
 AutomaticReconnectSecs=10
 Encode=MP3 Lame
@@ -13,8 +13,8 @@ ServerType=Icecast2
 ExternalFile=/tmp/test
 #YP Settings
 ServerStreamURL=http://www.pre-barreau.com
-ServerName=Pre-Barreau_-_ICP_-_CRFPA_-_Droit_administratif_Corrections
-ServerDescription=Pre-Barreau_-_ICP_-_CRFPA_-_Droit_administratif_Corrections_-_2_-_MARINHO_A._-_1er_cours
+ServerName=Pre-Barreau_-_ICP_-_ENM_-_undefined
+ServerDescription=Pre-Barreau_-_ICP_-_ENM_-_undefined_-_4_-_GIUSTINIANI_G._-_2e_cours
 ServerGenre=Teaching
 #Advanced Settings
 LogLevel=1
index d4b1c237533538e06176e12d072f6dce225aa709..9e268ad6f318077f26f2adc9737d51b528c4242e 100755 (executable)
@@ -122,6 +122,7 @@ class Station(Conference):
         oddconf.close()
 
     def start_oddcast(self):
+        os.makedirs(self.raw_dir)
         command = 'oddcastv3 -n "'+clean_string(self.conference)[0:16]+'" -c '+self.odd_conf_file+ \
                   ' alsa_pcm:capture_1 > /dev/null &'
         os.system(command)
@@ -144,7 +145,7 @@ class Station(Conference):
         command = 'streamripper ' + self.url + self.mount_point + \
                   ' -d '+self.output_dir+' -D "%S" -s -t --quiet > /dev/null &'
         os.system(command)
-        time.sleep(3)
+        time.sleep(1)
 
     def stop_oddcast(self):
         if len(self.odd_pid) != 0:
@@ -340,8 +341,7 @@ class WebView:
         print "<h5><span style=\"color: red\">"+message+"</span></h5>"
         print "<h5><span style=\"color: red\">Attention, il est important de remplir tous les champs, y compris le commentaire !</span></h5>"
         print "<TABLE BORDER = 0>"
-        print "<form method=post action=\"telecaster.py\" name=\"formulaire\">"
-        
+        print "<FORM method=POST ACTION=\""+self.url+"/telecaster/telecaster.py\" name=\"formulaire\">"
         print "<TR><TH align=\"left\">Titre :</TH><TD>"+self.title+"</TD></TR>"
         print "<TR><TH align=\"left\">D&eacute;partement :</TH>"
         print "<TD><select name=\"department\" onChange=\"choix(this.form)\">"
@@ -409,17 +409,16 @@ class WebView:
         
         print "<hr>"
         if writing:
-            print "<h4><span style=\"color: green\">Enregistrement en cours</span></h4>"
+            print "<h4><span style=\"color: green\">Enregistrement en cours...</span></h4>"
         else:
-            print "<h4><span style=\"color: red\">PAS d'enregistrement en cours</span></h4>"
+            print "<h4><span style=\"color: red\">PAS d'enregistrement en cours !</span></h4>"
         print '<hr>'
         if casting:
-            print "<h4><span style=\"color: green\">Diffusion en cours</span></h4>"
+            print "<h4><span style=\"color: green\">Diffusion en cours...</span></h4>"
         else:
-            print "<h4><span style=\"color: red\">PAS de diffusion en cours</span></h4>"
+            print "<h4><span style=\"color: red\">PAS de diffusion en cours !</span></h4>"
         print "<hr>"
         print "<TABLE BORDER = 0>"
-        print "<FORM METHOD = post ACTION = \"telecaster.py\">"
         print "<TR><TH align=\"left\">Titre :</TH><TD>"+self.title+"</TD></TR>"
         print "<TR><TH align=\"left\">D&eacute;partement :</TH><TD>"+department+"</TD><TR>"
         print "<TR><TH align=\"left\">Conference :</TH><TD>"+conference+"</TD><TR>"
@@ -433,6 +432,7 @@ class WebView:
               "."+self.format+".m3u\">Cliquez ici pour &eacute;couter cette formation en direct</a></h5>"
         print "</div>"
         print "<div id=\"tools\">"
+        print "<FORM METHOD = post ACTION = \""+self.url+"/telecaster/telecaster.py\">"
         print "<INPUT TYPE = hidden NAME = \"action\" VALUE = \"stop\">"
         print "<INPUT TYPE = submit VALUE = \"STOP\">"
         print "</FORM>"
@@ -485,13 +485,11 @@ class TeleCaster:
 
             s = Station(self.conf_file, self.conference_dict, self.lock_file)
             s.start()
-            time.sleep(4)
             if get_pid('^oddcastv3 -n [^LIVE]', self.uid) != []:
                 casting = True
             if get_pid('streamripper ', self.uid) == []:
                 writing = False
-            ws = WebView(self.school_file)
-            ws.stop_form(self.conference_dict, writing, casting)
+            w.stop_form(self.conference_dict, writing, casting)
             exit()
             
         elif odd_pid != [] and os.path.exists(self.lock_file) and not form.has_key("action"):