- Timestamp:
- Dec 6, 2011, 7:55:09 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
misc/music-files-sanitize.py
r297 r349 25 25 parser.add_argument('directories', nargs='+', metavar='DIR', type=str) 26 26 args = parser.parse_args() 27 28 print "# INFO: Going to parse directories %s" % args.directories 27 29 28 30 trans_table = { … … 74 76 return str(dest) 75 77 76 for root, dirs, files in os.walk(sys.argv[1],topdown=False): 77 for file in files + dirs: 78 new_file = make_ascii(file) 79 if new_file != file: 80 source = os.path.join(root,file) 81 target = os.path.join(root,new_file) 82 prefix = '# (dryrun) ' if args.dryrun else '' 83 print prefix, "Source:", source 84 print prefix, "Target:", target 85 if not args.dryrun: 86 os.rename(source,target) 78 for dir_root in args.directories: 79 for root, dirs, files in os.walk(dir_root,topdown=False): 80 for file in files + dirs: 81 new_file = make_ascii(file) 82 if new_file != file: 83 source = os.path.join(root,file) 84 target = os.path.join(root,new_file) 85 prefix = '# (dryrun) ' if args.dryrun else '' 86 print prefix, "Source:", source 87 print prefix, "Target:", target 88 if not args.dryrun: 89 os.rename(source,target)
Note:
See TracChangeset
for help on using the changeset viewer.