]> git.parisson.com Git - telecaster-client.git/commitdiff
Fix
authoryomguy <>
Wed, 28 Nov 2007 23:08:10 +0000 (23:08 +0000)
committeryomguy <>
Wed, 28 Nov 2007 23:08:10 +0000 (23:08 +0000)
etc/default_courses.xml [new file with mode: 0644]
etc/pre-barreau_courses.xml
etc/school_default.xml [deleted file]
etc/teleoddcast.cfg
teleoddcast.py

diff --git a/etc/default_courses.xml b/etc/default_courses.xml
new file mode 100644 (file)
index 0000000..22a72ab
--- /dev/null
@@ -0,0 +1,49 @@
+<teleoddcast>
+    <url>http://localhost</url>
+    <title>School Example</title>
+    <port>8000</port>
+    <department>
+        <name>Audio</name>
+        <courses>
+            <course>
+                <name>Course 1</name>
+            </course>
+            <course>
+                <name>Course 2</name>
+            </course>
+        </courses>
+    </department>
+    <department>
+        <name>Computer</name>
+        <courses>
+            <course>
+                <name>Course 1</name>
+            </course>
+            <course>
+                <name>Course 2</name>
+            </course>
+        </courses>
+    </department>
+    <department>
+        <name>Physics</name>
+        <courses>
+            <course>
+                <name>Course 1</name>
+            </course>
+            <course>
+                <name>Course 2</name>
+            </course>
+        </courses>
+    </department>
+    <department>
+        <name>Sociology</name>
+        <courses>
+            <course>
+                <name>Course 1</name>
+            </course>
+            <course>
+                <name>Course 1</name>
+            </course>
+        </courses>
+    </department>
+</teleoddcast>
index 7615b84aee9567ddda6223597e21b229bd4dd91e..f84ece132461a6866a1cd99cd131afbde5297e3e 100644 (file)
@@ -1,7 +1,8 @@
 <teleoddcast>
     <url>http://augustins.pre-barreau.com</url>
-    <title>Augustins - Pre-Barreau</title>
+    <title>Augustins - Pré-Barreau</title>
     <port>8000</port>
+    
     <department>
         <name>CRFPA</name>
         <courses>
     </department>
 
 </teleoddcast>
+:q!
\ No newline at end of file
diff --git a/etc/school_default.xml b/etc/school_default.xml
deleted file mode 100644 (file)
index 22a72ab..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<teleoddcast>
-    <url>http://localhost</url>
-    <title>School Example</title>
-    <port>8000</port>
-    <department>
-        <name>Audio</name>
-        <courses>
-            <course>
-                <name>Course 1</name>
-            </course>
-            <course>
-                <name>Course 2</name>
-            </course>
-        </courses>
-    </department>
-    <department>
-        <name>Computer</name>
-        <courses>
-            <course>
-                <name>Course 1</name>
-            </course>
-            <course>
-                <name>Course 2</name>
-            </course>
-        </courses>
-    </department>
-    <department>
-        <name>Physics</name>
-        <courses>
-            <course>
-                <name>Course 1</name>
-            </course>
-            <course>
-                <name>Course 2</name>
-            </course>
-        </courses>
-    </department>
-    <department>
-        <name>Sociology</name>
-        <courses>
-            <course>
-                <name>Course 1</name>
-            </course>
-            <course>
-                <name>Course 1</name>
-            </course>
-        </courses>
-    </department>
-</teleoddcast>
index eb7f7f03a7069357f10df864bfd3d31608736198..23283fee25b6c67dab0c09b256e7a130c4faa17e 100644 (file)
@@ -1,7 +1,7 @@
 Server=localhost
 Port=8000
 ServerPassword=source2parisson
-ServerMountpoint=/My_station_-_CRFPA_-_Procedure_civile_-_Cours.ogg
+ServerMountpoint=/Default_School_-_Audio_-_Course_2.ogg
 ServerPublic=0
 AutomaticReconnectSecs=10
 Encode=OggVorbis
@@ -13,8 +13,8 @@ ServerType=Icecast2
 ExternalFile=/home/pre-barreau/augustins/audio/
 #YP Settings
 ServerStreamURL=http://www.pre-barreau.com
-ServerName=My_station_-_CRFPA_-_Procedure_civile_-_Cours_-_1
-ServerDescription=My_station_-_CRFPA_-_Procedure_civile_-_Cours_-_1_-_rth_-_rtjh
+ServerName=Default_School_-_Audio_-_Course_2_-_1
+ServerDescription=Default_School_-_Audio_-_Course_2_-_1_-_azd_-_azd
 ServerGenre=Teaching
 #Advanced Settings
 LogLevel=1
index f59c9a5e582e89fc49dff01f62dbdeba11ee385a..cfaa9056237c46732dd11fa3ead7c0a819198325 100755 (executable)
@@ -131,11 +131,12 @@ class Station(Course):
         os.system(command)
 
     def stop_oddcast(self):
-        os.system('kill -9 ' + self.odd_pid[0])
+        if self.odd_pid[0]:
+            os.system('kill -9 ' + self.odd_pid[0])
         
     def stop_rip(self):
-        #print self.rip_pid[0]
-        os.system('kill -9 ' + self.rip_pid[0])
+        if self.rip_pid[0]:
+            os.system('kill -9 ' + self.rip_pid[0])
         time.sleep(1)
         date = datetime.datetime.now().strftime("%Y")
         if os.path.exists(self.file_dir) and os.path.exists(self.file_dir + os.sep + 'incomplete'):
@@ -301,7 +302,9 @@ class WebView:
         print "\t\t<TR><TH align=\"left\">Commentaire :</TH><TD>"+comment+"</TD><TR>"
         print "\t</TABLE>"
         print "<hr>"
-        print "<h5><a href=\""+self.url+":"+self.port+"/"+clean_string(self.title)+"_-_"+clean_string(department)+"_-_"+clean_string(course)+".ogg.m3u\">Cliquez ici pour &eacute;couter cette formation en direct</a></h5>"
+        print "<h5><a href=\""+self.url+":"+self.port+"/"+clean_string(self.title) + \
+              "_-_"+clean_string(department)+"_-_"+clean_string(course) + \
+              ".ogg.m3u\">Cliquez ici pour &eacute;couter cette formation en direct</a></h5>"
         print "</div>"
         print "<div id=\"tools\">"
         print "\t<INPUT TYPE = hidden NAME = \"action\" VALUE = \"stop\">"
@@ -314,6 +317,8 @@ class WebView:
 
 
 class TeleOddCast:
+    """Manage the calls of Station and Webview to get the network and
+    disk streams"""
 
     def __init__(self, conf_file, school_file):
         """Main function"""
@@ -366,7 +371,7 @@ class TeleOddCast:
 
 # Call main function.
 conf_file = 'etc/teleoddcast.xml'
-school_file = 'etc/localhost.xml'
+school_file = 'etc/default_courses.xml'
 
 if __name__ == '__main__':
     t = TeleOddCast(conf_file, school_file)