From: yomguy <> Date: Fri, 25 Jul 2008 18:06:03 +0000 (+0000) Subject: * Fix file path X-Git-Tag: 0.9~312 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=9a93ae98daff0448b1fb66e2b296c9c65a055e62;p=telecaster-client.git * Fix file path --- diff --git a/etc/telecaster_mp3.cfg b/etc/telecaster_mp3.cfg index d5a4fa4..adc6072 100644 --- a/etc/telecaster_mp3.cfg +++ b/etc/telecaster_mp3.cfg @@ -1,7 +1,7 @@ Server=localhost Port=8000 ServerPassword=source2parisson -ServerMountpoint=/Pre-Barreau_-_ICP_-_CRFPA_-_TEST.mp3 +ServerMountpoint=/Pre-Barreau_-_ICP_-_CRFPA_-_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_-_TEST -ServerDescription=Pre-Barreau_-_ICP_-_CRFPA_-_TEST_-_1_-_GIUSTINIANI_G._-_2e_corrections +ServerName=Pre-Barreau_-_ICP_-_CRFPA_-_undefined +ServerDescription=Pre-Barreau_-_ICP_-_CRFPA_-_undefined_-_1_-_MEUNIER_J._-_2e_corrections ServerGenre=Teaching #Advanced Settings LogLevel=1 diff --git a/telecaster.py b/telecaster.py index 9cc482e..77acbf5 100755 --- a/telecaster.py +++ b/telecaster.py @@ -60,8 +60,9 @@ class Station(Conference): Conference.__init__(self, conference_dict) self.date = datetime.datetime.now().strftime("%Y") self.time = datetime.datetime.now().strftime("%x-%X") - self.time = self.time.replace('/','_') - self.time = self.time.replace(':','_') + self.time1 = self.time.replace('/','_') + self.time2 = self.time1.replace(':','_') + self.time = self.time2.replace(' ','_') self.conf = xml2dict(conf_file) self.conf = self.conf['telecaster'] self.root_dir = self.conf['server']['root_dir'] @@ -160,9 +161,9 @@ class Station(Conference): 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'): - shutil.move(self.file_dir+os.sep+'incomplete'+os.sep+' - .'+self.format, self.file_dir+os.sep) - shutil.rmtree(self.file_dir+os.sep+'incomplete'+os.sep) + shutil.copy(self.file_dir+os.sep+'incomplete'+os.sep+' - .'+self.format, self.file_dir+os.sep) os.rename(self.file_dir+os.sep+' - .'+self.format, self.file_dir+os.sep+self.filename) + shutil.rmtree(self.file_dir+os.sep+'incomplete'+os.sep) def mp3_convert(self): os.system('oggdec -o - '+ self.file_dir+os.sep+self.filename+' | lame -S -m m -h -b '+ self.bitrate + \ @@ -195,7 +196,7 @@ class Station(Conference): #tag = tags.__dict__['ALBUM'] audio.add(TAL(encoding=3, text=self.title)) #tag = tags.__dict__['DATE'] - #audio.add(TDA(encoding=3, text=self.date)) + audio.add(TDA(encoding=3, text=self.date)) #tag = tags.__dict__['GENRE'] audio.add(TCO(encoding=3, text=self.genre)) #tag = tags.__dict__['COMMENT']