Package: telemeta
Architecture: any
-Depends: python (>= 2.3.5-7), python-xml, python-central (>= 0.5), python-mutagen, sox, vorbis-tools, flac, lame, normalize-audio, ecasound, festival, par2
+Depends: python (>= 2.3.5-7), python-xml, python-central (>= 0.5),
+python-mutagen, python-django, sox, vorbis-tools, flac, lame, normalize-audio,
+ecasound, festival, par2, python-mysqldb, sqlite3 | mysql-server
XB-Python-Version: ${python:Versions}
Description: backups, transcodes, tags and marks any audio content with metadata
Telemeta is an audio tool which creates audio transcoded databases fast from
# Define and create the destination path
# At the moment, the target directory is built with this scheme in
# the cache directory : ./%Format/%Collection/%Artist/
- self.dest = self.cache_dir
+ self.cache_dir = os.path.join(self.cache_dir,'cache')
#export_dir = os.path.join(self.ext,self.collection,self.artist)
- export_dir = self.ext
- if not os.path.exists(os.path.join(self.dest,export_dir)):
- for _dir in export_dir.split(os.sep):
- self.dest = os.path.join(self.dest,_dir)
- if not os.path.exists(self.dest):
- os.mkdir(self.dest)
+ export_dir = os.path.join(self.cache_dir,self.ext)
+
+ if not os.path.exists(export_dir):
+ export_dir_split = export_dir.split(os.sep)
+ path = export_dir_split[0]
+ for _dir in export_dir_split[1:]:
+ path = os.path.join(path,_dir)
+ if not os.path.exists(path):
+ os.mkdir(path)
else:
- self.dest = os.path.join(self.dest,export_dir)
+ self.dest = export_dir
# Set the target file
#target_file = file_name_wo_ext+'.'+self.ext
return 'Exporter error [1]: path does not exist.'
def clean_word(word) :
- """ Return the word without excessive blank spaces and underscores """
+ """ Return the word without excessive blank spaces, underscores and
+ characters causing problem to exporters"""
word = re.sub("^[^\w]+","",word) #trim the beginning
word = re.sub("[^\w]+$","",word) #trim the end
- #word = string.replace(word,' ','_')
word = re.sub("_+","_",word) #squeeze continuous _ to one _
word = re.sub("^[^\w]+","",word) #trim the beginning _
+ #word = string.replace(word,' ','_')
#word = string.capitalize(word)
+ dict = '&[];"*'
+ for letter in dict:
+ word = string.replace(word,letter,'_')
return word
def recover_par_key(path):
'| flac '+self.args+' -c -'
# Pre-proccessing
- try:
- self.dest = self.pre_process(self.item_id,
+ #try:
+ self.dest = self.pre_process(self.item_id,
self.source,
self.metadata,
self.ext,
self.cache_dir,
self.options)
- except:
- yield 'ExporterError [3]: pre_process'
+ #except:
+ #raise 'ExporterError [3]: pre_process'
# Processing (streaming + cache writing)
try:
for chunk in stream:
yield chunk
except:
- yield 'ExporterError: core_process'
+ raise 'ExporterError: core_process'
# Post-proccessing
try:
self.cache_dir,
self.options)
except:
- yield 'ExporterError: post_process'
+ raise 'ExporterError: post_process'
# Encoding
else:
args = args + ' -S -c -o '
- for tag in self.metadata.keys():
- if tag in self.dub2args_dict.keys():
- arg = self.dub2args_dict[tag]
- value = self.metadata[tag]
- args = args + ' --' + arg + ' "' +value +'" '
+ #for tag in self.metadata.keys():
+ #if tag in self.dub2args_dict.keys():
+ #arg = self.dub2args_dict[tag]
+ #value = clean_word(self.metadata[tag])
+ #args = args + ' --' + arg + ' "' +value +'" '
return args
self.cache_dir,
self.options)
except:
- yield 'ExporterError [3]: pre_process'
+ raise 'ExporterError [3]: pre_process'
# Processing (streaming + cache writing)
try:
for chunk in stream:
yield chunk
except:
- yield 'ExporterError: core_process'
+ raise 'ExporterError: core_process'
# Post-proccessing
try:
self.cache_dir,
self.options)
except:
- yield 'ExporterError: post_process'
+ raise 'ExporterError: post_process'
# Encoding
# os.system('lame '+args+' --tc "default" "'+self.source+
self.cache_dir,
self.options)
except:
- yield 'ExporterError [3]: pre_process'
+ raise 'ExporterError [3]: pre_process'
# Processing (streaming + cache writing)
try:
for chunk in stream:
yield chunk
except:
- yield 'ExporterError: core_process'
+ raise 'ExporterError: core_process'
# Post-proccessing
try:
self.cache_dir,
self.options)
except:
- yield 'ExporterError: post_process'
+ raise 'ExporterError: post_process'
self.options)
except IOError:
- yield 'ExporterError [3]: source file does not exist.'
+ raise 'ExporterError [3]: source file does not exist.'