|
@ -579,7 +579,6 @@ class Renamer(Plugin): |
|
|
for src in rename_files: |
|
|
for src in rename_files: |
|
|
if rename_files[src]: |
|
|
if rename_files[src]: |
|
|
dst = rename_files[src] |
|
|
dst = rename_files[src] |
|
|
log.info('Renaming "%s" to "%s"', (src, dst)) |
|
|
|
|
|
|
|
|
|
|
|
# Create dir |
|
|
# Create dir |
|
|
self.makeDir(os.path.dirname(dst)) |
|
|
self.makeDir(os.path.dirname(dst)) |
|
@ -785,6 +784,7 @@ Remove it if you want it to be renamed (again, or at least let it try again) |
|
|
|
|
|
|
|
|
if move_type not in ['copy', 'link']: |
|
|
if move_type not in ['copy', 'link']: |
|
|
try: |
|
|
try: |
|
|
|
|
|
log.info('Moving "%s" to "%s"', (old, dest)) |
|
|
shutil.move(old, dest) |
|
|
shutil.move(old, dest) |
|
|
except: |
|
|
except: |
|
|
if os.path.exists(dest): |
|
|
if os.path.exists(dest): |
|
@ -793,8 +793,10 @@ Remove it if you want it to be renamed (again, or at least let it try again) |
|
|
else: |
|
|
else: |
|
|
raise |
|
|
raise |
|
|
elif move_type == 'copy': |
|
|
elif move_type == 'copy': |
|
|
|
|
|
log.info('Copying "%s" to "%s"', (old, dest)) |
|
|
shutil.copy(old, dest) |
|
|
shutil.copy(old, dest) |
|
|
else: |
|
|
else: |
|
|
|
|
|
log.info('Linking "%s" to "%s"', (old, dest)) |
|
|
# First try to hardlink |
|
|
# First try to hardlink |
|
|
try: |
|
|
try: |
|
|
log.debug('Hardlinking file "%s" to "%s"...', (old, dest)) |
|
|
log.debug('Hardlinking file "%s" to "%s"...', (old, dest)) |
|
|