import shutil
import datetime
import time
+import urllib
import codecs
import string
import signal
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):
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()
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()
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):
self.conference_nb_max = 40
self.professor_nb_max = 40
self.refresh = False
+ self.refresh_value = 20
self.uid = os.getuid()
def header(self):
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\">"