Changeset f6b8739a76fc9622b587c9934842c7aca301f2ea


Ignore:
Timestamp:
04/03/07 05:08:55 (5 years ago)
Author:
flupke <flupke@…>
Children:
a0c966a567a9eda5413768e12c54db92fd36b731
Parents:
7f6c5058e82762b3d7a6f1d8105ad513db745376
git-committer:
flupke <flupke@…> (04/03/07 05:08:55)
Message:
  • Déplacé gplify dans utils
  • Petit bug fix sur mp3rename

git-svn-id:  http://kawa.selfip.org/svn/projects@425 532e76a9-45ae-c241-9c6d-8309ac6440cd

Location:
utils
Files:
2 edited
8 moved

Legend:

Unmodified
Added
Removed
  • utils/mp3rename/trunk/fixtags

    r32217b4 rf6b8739  
    110110 
    111111def help(): 
    112     print "Usage:" 
    113     print "   fixtags [options] [action] directory" 
    114     print "Actions:" 
    115     print "   --help  display this message" 
    116     print "   --check check the directory tree consistency" 
    117     print "   --move  move tags, e.g. move the artist tag to the compositor" 
    118     print "           tag" 
    119     print "Options:" 
    120     print "   When in move tags mode :" 
    121     print "      --source      ATTRIBUTE the attribute to move from" 
    122     print "      --destination ATTRIBUTE the attribute to move to" 
    123     print "      --set-source  VALUE     the source attribute will be set" 
    124     print "                              to VALUE" 
    125     print 
    126     print 
    127     print "   The default action is to check the given directory" 
     112    print """Usage: fixtags [options] [action] directory 
     113Actions: 
     114   --help   display this message 
     115   --check  check the directory tree consistency 
     116   --move   move tags, e.g. move the artist tag to the compositor 
     117            tag 
     118   --create create tags from file names 
     119Options: 
     120   When in move tags mode : 
     121      --source      ATTRIBUTE the attribute to move from 
     122      --destination ATTRIBUTE the attribute to move to 
     123      --set-source  VALUE     the source attribute will be set 
     124                              to VALUE 
     125 
     126   When in create mode : 
     127      --album  ALBUM 
     128      --year   YEAR 
     129      --artist ARTIST 
     130 
     131 
     132   The default action is to check the given directory""" 
     133 
    128134 
    129135 
  • utils/mp3rename/trunk/mp3rename

    r04855b0 rf6b8739  
    168168 
    169169 
    170 def getTrackFileName(basePath, trackNumber, title, fnamesCharset, fsCharset,  
    171         extension='mp3'): 
     170def getTrackFileName(basePath, trackNumber, title, fsCharset, extension='mp3'): 
    172171  fileName = '%02d - %s.%s' % (trackNumber + 1, translateFilename(title), extension) 
    173172  if basePath: 
     
    176175 
    177176 
    178 def getDirName(basePath, artist, album): 
     177def getDirName(basePath, artist, album, fsCharset): 
    179178  dirName = translateFilename('%s - %s' % (artist, album)) 
    180179  if basePath: 
    181     dirName = basePath + '/' + dirName 
     180    dirName = basePath + '/' + dirName.encode(fsCharset) 
    182181  return dirName 
    183182 
     
    497496    # Rename file 
    498497    newFileName = getTrackFileName(os.path.dirname(file), i, titles[i], 
    499             fnamesCharset, fsCharset) 
     498            fsCharset) 
    500499    if verbose: 
    501500      print "Moving '%s' to '%s'" % (file, newFileName) 
     
    506505  if gaveDir and renameDir: 
    507506    oldDir = args[0] 
    508     newDir = getDirName(os.path.dirname(args[0]), artist, album) 
     507    newDir = getDirName(os.path.dirname(args[0]), artist, album, fsCharset) 
    509508    if verbose: 
    510509      print "Moving directory '%s' to '%s'" % (oldDir, newDir) 
Note: See TracChangeset for help on using the changeset viewer.