]> git.parisson.com Git - telecaster-client.git/commitdiff
fix utf8, jack ports
authoryomguy <>
Thu, 4 Feb 2010 15:29:15 +0000 (15:29 +0000)
committeryomguy <>
Thu, 4 Feb 2010 15:29:15 +0000 (15:29 +0000)
etc/telecaster_mp3.cfg
station.py
tools/tools.py
webview.py

index eee50e282009e64c3bf5fe76c44316d9f23808b4..1068f8fc7ebcb64aa3cce9d0440997c46976c6e3 100644 (file)
@@ -8,7 +8,7 @@ Encode=MP3 Lame
 BitrateNominal=96
 OggQuality=3
 NumberChannels=2
-Samplerate=44100
+Samplerate=48000
 ServerType=Icecast2
 ExternalFile=/tmp/test
 #YP Settings
index e77c3598cbaf768e9c5eb26c0450aca22a82a79a..1fdd6901fb738017e00b6951e31e59087efc483e 100644 (file)
@@ -25,6 +25,7 @@ import os
 import shutil
 import datetime
 import time
+import urllib
 import codecs
 import string
 import signal
@@ -201,14 +202,14 @@ class Station(Conference):
        file = self.file_dir + os.sep + self.filename
        if os.path.exists(file):
             audio = OggVorbis(file)
-            audio['TITLE'] = self.new_title
-            audio['ARTIST'] = self.professor
-            audio['ALBUM'] = self.title
-            audio['DATE'] = self.date
-            audio['GENRE'] = self.genre
-            audio['SOURCE'] = self.title
-            audio['ENCODER'] = self.encoder
-            audio['COMMENT'] = self.comment
+            audio['TITLE'] = self.new_title.decode('utf8')
+            audio['ARTIST'] = self.professor.decode('utf8')
+            audio['ALBUM'] = self.title.decode('utf8')
+            audio['DATE'] = self.date.decode('utf8')
+            audio['GENRE'] = self.genre.decode('utf8')
+            audio['SOURCE'] = self.title.decode('utf8')
+            audio['ENCODER'] = self.encoder.decode('utf8')
+            audio['COMMENT'] = self.comment.decode('utf8')
             audio.save()
 
     def write_tags_mp3(self):
@@ -217,15 +218,15 @@ class Station(Conference):
             os.system('mp3info -t "a" -a "a" '+file)
             audio = ID3(file)
             #tag = tags.__dict__['TITLE']
-            audio.add(TIT2(encoding=3, text=self.new_title))
+            audio.add(TIT2(encoding=3, text=self.new_title.decode('utf8')))
             #tag = tags.__dict__['ARTIST']
-            audio.add(TP1(encoding=3, text=self.professor))
+            audio.add(TP1(encoding=3, text=self.professor.decode('utf8')))
             #tag = tags.__dict__['ALBUM']
-            audio.add(TAL(encoding=3, text=self.title))
+            audio.add(TAL(encoding=3, text=self.title.decode('utf8')))
             #tag = tags.__dict__['DATE']
-            audio.add(TDA(encoding=3, text=self.date))
+            audio.add(TDA(encoding=3, text=self.date.decode('utf8')))
             #tag = tags.__dict__['GENRE']
-            audio.add(TCO(encoding=3, text=self.genre))
+            audio.add(TCO(encoding=3, text=self.genre.decode('utf8')))
             #tag = tags.__dict__['COMMENT']
             #audio.add(COM(encoding=3, text=self.comment))
             audio.save()
@@ -323,6 +324,6 @@ class Station(Conference):
                             lastBuildDate = str(time_now),
                             items = rss_item_list,)
 
-        f = open(self.rss_dir + os.sep + self.rss_file, 'w')
-        rss.write_xml(f, 'utf-8')
-        f.close()
+        #f = open(self.rss_dir + os.sep + self.rss_file, 'w')
+        #rss.write_xml(f, 'utf-8')
+        #f.close()
index 9e840505dd64d9337c89aada489fb613959b69a9..9527f6bcad524f7e11981941fb6ccfa2a0f38434 100644 (file)
@@ -50,8 +50,8 @@ def get_lines(file):
 def clean_string(string):
        """removes blank spaces and accents"""
        string = string.replace(' ','_')
-       string = string.replace('é','e')
-       string = string.replace('è','e')
+       #string = string.replace('é','e')
+       #string = string.replace('è','e')
        return string
 
 def xml2dict(conf_file):
index 192263e10846dd1081cf2fd4393db35010246e93..b16aab3cba0e55d066df55f90d2517e7e6d04b81 100644 (file)
@@ -74,6 +74,7 @@ class WebView(FieldStorage):
         self.conference_nb_max = 40
         self.professor_nb_max = 40
         self.refresh = False
+        self.refresh_value = 20
         self.uid = os.getuid()
 
     def header(self):
@@ -112,16 +113,19 @@ class WebView(FieldStorage):
         print '      formulaire.conference.selectedIndex=0;}'
         print '</script>'
 
+        # rss ajax
+        #print "<script type=\"text/javascript\" src=\"js/rssajax.js\"></script>"
+        #print "<script type=\"text/javascript\">"
+        #print " function rss_reload(url) {"
+        #print "  getRSS(url)"
+        #print "  setTimeout(\"rss_reload(\'\" + url + \"\')\", 10000);}"
+        #print "</script>"
 
-        print "<script type=\"text/javascript\" src=\"js/rssajax.js\"></script>"
-        print "<script type=\"text/javascript\">"
-        print " function rss_reload(url) {"
-        print "  getRSS(url)"
-        print "  setTimeout(\"rss_reload(\'\" + url + \"\')\", 10000);}"
-        print "</script>"
         if self.refresh:
-            print "<meta http-equiv=\"refresh\" content=\"10; URL=telecaster.py\">"
+            print "<meta http-equiv=\"refresh\" content=\"" + str(self.refresh_value) + "; URL=telecaster.py\">"
+
         print "</HEAD>\n"
+
         #print "<BODY bgcolor =\"#ffffff\" onload=\"rss_reload(\'" + self.rss_url + "\');\">"
         print "<BODY bgcolor =\"#ffffff\">"
         print "<div class=\"bg\">"