]> git.parisson.com Git - telemeta.git/commitdiff
Debugging, added md5sum checkup fonctionnality
authormomo <>
Tue, 30 Jan 2007 05:03:01 +0000 (05:03 +0000)
committermomo <>
Tue, 30 Jan 2007 05:03:01 +0000 (05:03 +0000)
audio_tools.py
debian/telemeta.1
doc/html/index.html
telemeta.py

index f57d0808ce1683825622de9d4605c20f8fa23790..dca5198d5ce86ab174931a6065144480eb435501 100755 (executable)
@@ -27,7 +27,7 @@ def encode(enc_type,dir_in,file_in,dir_out,file_out):
 
        if enc_type == 'flac' :
                quality = tag_tools.get_opt_value(enc_type+'_quality')
-               os.system('flac -V -q '+quality+' -o "'+media_out+'" "'+media_in+'"')
+               os.system('flac -f -V -q '+quality+' -o "'+media_out+'" "'+media_in+'"')
 
        if enc_type == 'ogg':
                bitrate = tag_tools.get_opt_value(enc_type+'_bitrate')
@@ -62,6 +62,44 @@ def decode(media_in,file_ext):
 def normalize(media_in):
        os.system('normalize-audio "'+media_in+'"')
 
+def create_md5_key(dir_in,file_in):
+       media_in = dir_in+file_in
+       os.system('md5sum -b "'+media_in+'" "'+media_in+'.md5"')
+
+def check_md5_key(dir_in,file_in):
+       media_in = dir_in+file_in
+       md5_log = os.popen4('md5sum -c "'+media_in+'" "'+media_in+'.md5"')
+       if 'OK' in md5_log.split(':'):
+               return True
+       else:
+               return False
+
+def compare_md5_key(file_in,file_out):
+       media_in = file_in
+       media_out = file_out
+       if not os.path.exists(media_in):
+               return False
+       else:
+               print 'Checking md5sums...'
+               file_in_in, file_in_out = os.popen4('md5sum -b "'+media_in+'"')
+               file_out_in, file_out_out = os.popen4('md5sum -b "'+media_out+'"')
+               for line in file_in_out.readlines():
+                       line = line.split('*')
+                       line = line[0]
+                       #print line
+                       for file_out_out_line in file_out_out.readlines():
+                               file_out_out_line= file_out_out_line.split('*')
+                               file_out_out_line= file_out_out_line[0]
+                               #print file_out_out_line        
+                               if line == file_out_out_line:
+                                       print 'Files are equal...\n'
+                                       return True
+                                       exit
+                               else:
+                                       print 'Files are different...\n'
+                                       return False
+                                       exit
+               
 def create_par_key(dir_in,file_in):
        media_in = dir_in+file_in
        os.system('par2 c -n1 "'+media_in+'"')
index a216a4152b1a4064744de018263604eb6810e42d..9ea1d7c6b77b098ee0c43351eb5903ccdaa9ec41 100644 (file)
@@ -3,19 +3,12 @@
 telemeta \(em backups, transcodes, tags and marks any audio content with metadata 
 .SH "SYNOPSIS" 
 .PP 
-\fBtelemeta\fR [\fB\fIOPTIONS\fR\fP]  [\fB\fIMEDIA\fR\fP]  
+\fBtelemeta\fR [\fB\fIOPTIONS\fR\fP]  [\fICOLLECTION\fR]  [\fB\fIOPTIONS\fR\fP]  [\fB\fIMEDIA\fR\fP]  
 .SH "DESCRIPTION" 
 .PP 
-This manual page documents briefly the 
-\fBtelemeta\fR command. 
+\fBtelemeta\fR is an audio tool which creates audio transcoded collections fast from fresh mastered files. It can be useful to backup digitalized audio media from vinyls, old tapes or whatever and include them in a database. 
 .PP 
-This manual page was written for the \fBDebian\fP distribution 
-because the original program does not have a manual page. 
-Instead, it has documentation in the GNU \fBInfo\fP format; see below. 
-.PP 
-\fBtelemeta\fR is an audio tool which creates audio transcoded databases fast from fresh mastered files. It can be useful to backup digitalized audio media from vinyls, old tapes or whatever. 
-.PP 
-Telemeta first creates a simple structure where original sounds will be backuped. The files can be transcoded to WAV, FLAC, MP3 and OGG including the corresponding tags. 
+Telemeta first creates a simple file structure where the original sounds will be backuped. The files can be transcoded to WAV, FLAC, MP3 and OGG including the corresponding tags. 
 .PP 
 Here are some cool functions: 
 .IP "\fB\fP" 10 
@@ -25,7 +18,7 @@ Here are some cool functions:
 .IP "" 10 
 \- File corruption security with par2 recovery files 
 .IP "" 10 
-\- Database synchronizing to remote servers (ssh+rsync) 
+\- Collection synchronizing to remote servers (ssh+rsync) 
 .IP "" 10 
 \- Modify metadata from XML or interactive shell 
 .SH "OPTIONS" 
@@ -35,13 +28,13 @@ with long options starting with two dashes (`\-').  A summary of
 options is included below.  For a complete description, see the 
 \fBInfo\fP files. 
 .IP "\fB\-\-create\fP         " 10 
-creates a database repository and default database xml 
+creates a collection repository 
 .IP "\fB\-\-backup\fP         " 10 
-backups a media to the database 
+backups and transcodes wave files to a collection 
 .IP "\fB\-\-album\fP         " 10 
 proccesses an entire directory (one shot album) 
 .IP "\fB\-\-backup\fP         " 10 
-backups a media to the database 
+backups a media to the collection 
 .IP "\fB\-\-from-xml\fP         " 10 
 takes tags and opts in original xml source 
 .IP "\fB\-\-force\fP         " 10 
@@ -53,22 +46,58 @@ chooses default argument for all question
 .IP "\fB\-\-recover\fP         " 10 
 check an repair the backuped media with the previously created "par2" security files 
 .IP "\fB\-\-rsync\fP         " 10 
-synchronizes database to a remote server (ssh+rsync) 
-.IP "\fB\-\-erase-media\fP         " 10 
-erases converted database 
+synchronizes collection to a remote server (ssh+rsync) 
+.IP "\fB\-\-erase\fP         " 10 
+erases a collection (flac, ogg, mp3 only !) 
 .IP "\fB\-\-help\fP         " 10 
 Show summary of options. 
-.IP "\fB-v\fP           \fB\-\-version\fP         " 10 
+.IP "\fB\-\-version\fP         " 10 
 Show version of program. 
-.SH "SEE ALSO
+.SH "EXAMPLES
 .PP 
-oggenc (1), flac (1), etc... 
+\fBtelemeta \-\-create my_collection\fR 
 .PP 
-The programs are documented fully by Guillaume Pellerin. More info at \fIhttp://yomix.org/telemeta\fP. 
+\fBtelemeta \-\-backup my_collection file.wav\fR 
+.PP 
+\fBtelemeta \-\-backup my_collection \-\-album /path/to/directory/\fR 
+.PP 
+\fBtelemeta \-\-backup my_collection \-\-album \-\-par2 \-\-rsync /path/to/directory/\fR 
+.PP 
+\fBtelemeta \-\-backup my_collection \-\-album \-\-par2 \-\-rsync \-\-force /path/to/directory/\fR 
+.SH "DOWNLOAD" 
+.PP 
+Telemeta is written in python. So it doesn't require any compilation step. 
+.PP 
+On Debian or Ubuntu just add these lines to your /etc/apt/sources-list: 
+.PP 
+\fBdeb http://yomix.org/debian/ binary/\fR 
+.PP 
+\fBdeb-src http://yomix.org/debian/ source/\fR 
+.PP 
+Then, 
+.PP 
+\fBsudo apt-get update\fR 
+.PP 
+\fBsudo apt-get install telemeta\fR 
+.PP 
+On other linux platforms, \fIdownload (link to URL http://yomix.org/telemeta/download/) \fR the lastest .tar.gz archive, uncompress it, go into the created directory and just type this with your favorite shell : 
+.PP 
+\fBpython install.py\fR 
+.PP 
+See README and INSTALL file for more informations. 
+.PP 
+You can also get the lastest version of Telemeta with subversion (just type 'enter' for the password: 
+.PP 
+svn co http://svn.yomix.org/svn/telemeta/trunk telemeta \-\-username=anonymous 
+.SH "DEPENDS" 
+.PP 
+python (>= 2.3.5-7), python-xml, python-central (>= 0.5), python-mutagen, sox, vorbis-tools, flac, lame, normalize-audio, ecasound, festival, par2 
+.SH "SEE ALSO" 
+.PP 
+The program is documented fully by Guillaume Pellerin. More info at \fI\fIhttp://svn.yomix.org/telemeta/ (link to URL http://svn.yomix.org/telemeta/) \fR\fP. 
 .SH "AUTHOR" 
 .PP 
-This manual page was written by Guillaume Pellerin <pellerin@parisson.com> for 
+This manual page was written by Guillaume Pellerin <yomguy@altern.org> for 
 the \fBDebian\fP system (but may be used by others).  Permission is 
 granted to copy, distribute and/or modify this document under 
 the terms of the GNU General Public License, Version 2 any 
@@ -78,4 +107,4 @@ later version published by the Free Software Foundation.
 On Debian systems, the complete text of the GNU General Public 
 License can be found in /usr/share/common-licenses/GPL. 
  
-.\" created by instant / docbook-to-man, Mon 08 Jan 2007, 03:12 
+.\" created by instant / docbook-to-man, Fri 26 Jan 2007, 00:26 
index d6f2642ff586601b234808562b93c3ccfffc9953..00b72224e644e63378be4ff4d95bc58fa4bfaa5f 100644 (file)
@@ -76,25 +76,6 @@ NAME="AEN32"
 ><H2
 >DESCRIPTION</H2
 ><P
->This manual page documents briefly the
-      <B
-CLASS="COMMAND"
->telemeta</B
-> command.</P
-><P
->This manual page was written for the <SPAN
-CLASS="PRODUCTNAME"
->Debian</SPAN
-> distribution
-      because the original program does not have a manual page.
-      Instead, it has documentation in the <ACRONYM
-CLASS="ACRONYM"
->GNU</ACRONYM
-> <SPAN
-CLASS="APPLICATION"
->Info</SPAN
-> format; see below.</P
-><P
 ><B
 CLASS="COMMAND"
 >telemeta</B
@@ -131,7 +112,7 @@ CLASS="OPTION"
 ><DIV
 CLASS="REFSECT1"
 ><A
-NAME="AEN54"
+NAME="AEN48"
 ></A
 ><H2
 >OPTIONS</H2
@@ -274,7 +255,7 @@ CLASS="OPTION"
 ><DIV
 CLASS="REFSECT1"
 ><A
-NAME="AEN125"
+NAME="AEN119"
 ></A
 ><H2
 >EXAMPLES</H2
@@ -307,14 +288,14 @@ CLASS="COMMAND"
 ><DIV
 CLASS="REFSECT1"
 ><A
-NAME="AEN137"
+NAME="AEN131"
 ></A
 ><H2
 >DOWNLOAD</H2
 ><P
 >Telemeta is written in python. So it doesn't require any compilation step.</P
 ><P
->On debian or Ubuntu just add these lines to your /etc/apt/sources-list:</P
+>On Debian or Ubuntu just add these lines to your /etc/apt/sources-list:</P
 ><P
 ><B
 CLASS="COMMAND"
@@ -350,11 +331,15 @@ CLASS="COMMAND"
 ></P
 ><P
 >See README and INSTALL file for more informations.</P
+><P
+>You can also get the lastest version of Telemeta with subversion (just type 'enter' for the password:</P
+><P
+>svn co http://svn.yomix.org/svn/telemeta/trunk telemeta --username=anonymous</P
 ></DIV
 ><DIV
 CLASS="REFSECT1"
 ><A
-NAME="AEN155"
+NAME="AEN151"
 ></A
 ><H2
 >DEPENDS</H2
@@ -364,7 +349,7 @@ NAME="AEN155"
 ><DIV
 CLASS="REFSECT1"
 ><A
-NAME="AEN158"
+NAME="AEN154"
 ></A
 ><H2
 >SEE ALSO</H2
@@ -372,16 +357,16 @@ NAME="AEN158"
 >The program is documented fully by Guillaume Pellerin. More info at <I
 CLASS="CITETITLE"
 ><A
-HREF="http://yomix.org/telemeta/"
+HREF="http://svn.yomix.org/telemeta/"
 TARGET="_top"
->http://yomix.org/telemeta/</A
+>http://svn.yomix.org/telemeta/</A
 ></I
 >.</P
 ></DIV
 ><DIV
 CLASS="REFSECT1"
 ><A
-NAME="AEN163"
+NAME="AEN159"
 ></A
 ><H2
 >AUTHOR</H2
@@ -389,8 +374,8 @@ NAME="AEN163"
 >This manual page was written by Guillaume Pellerin &#60;<CODE
 CLASS="EMAIL"
 >&#60;<A
-HREF="mailto:pellerin@parisson.com"
->pellerin@parisson.com</A
+HREF="mailto:yomguy@altern.org"
+>yomguy@altern.org</A
 >&#62;</CODE
 >&#62; for
       the <SPAN
index 092d492e3ed7cdca4032d8c9b897a13712602a16..4b7580e62ae55c85a82fcede008d25357d0d2e61 100755 (executable)
@@ -225,7 +225,7 @@ if mode_create :
                if not os.path.exists(collection_dir):
                        os.mkdir(collection_dir)
                else :
-                       sys.exit('ERROR: the collection '+collection_name+' already exists')
+                               sys.exit('ERROR: the collection '+collection_name+' already exists')
                tag_tools.write_collection_consts(default_collection_xml)
                tag_tools.write_collection_consts(collection_dir+os.sep+collection_name+'.xml')
                # Parses collection data
@@ -312,9 +312,12 @@ for file in file_master_list :
                        album_dir = collection_dir+os.sep+'src'+os.sep+album_dir_tmp+os.sep
                        if not os.path.exists(album_dir) :
                                os.mkdir(album_dir)
-                       print 'Copying files into: '+album_dir+'\n'
-                       if isaudio(master_dir+file) and ( not os.path.exists(album_dir+file) or mode_force ) :
+                       if isaudio(master_dir+file) and ( not audio_tools.compare_md5_key(master_dir+file,album_dir+file) or mode_force ) :
+                               print 'Copying files into: '+album_dir+''
                                os.system('cp -ra "'+master_dir+file+'" '+album_dir)
+                               print 'OK\n'
+                       #else:
+                       #       sys.exit(master_dir+file+' is not an audio file...')
                        src_dir = album_dir
                        dir_in = src_dir
                else :