Flip condition to return early.
This commit is contained in:
parent
4a50ac5aed
commit
0c529909c8
1 changed files with 9 additions and 7 deletions
16
brename.py
16
brename.py
|
@ -88,13 +88,15 @@ def brename(transformation, autoyes=False, do_naturalsort=False, recurse=False):
|
||||||
|
|
||||||
loop(pairs, dry=True)
|
loop(pairs, dry=True)
|
||||||
|
|
||||||
if autoyes or interactive.getpermission('Is this correct?'):
|
if not (autoyes or interactive.getpermission('Is this correct?')):
|
||||||
# Sort in reverse so that renaming a file inside a directory always
|
return
|
||||||
# occurs before renaming the directory itself. If you rename the
|
|
||||||
# directory first, then the path to the file is invalid by the time
|
# Sort in reverse so that renaming a file inside a directory always
|
||||||
# you want to rename it.
|
# occurs before renaming the directory itself. If you rename the
|
||||||
pairs = sorted(pairs, reverse=True)
|
# directory first, then the path to the file is invalid by the time
|
||||||
loop(pairs, dry=False)
|
# you want to rename it.
|
||||||
|
pairs = sorted(pairs, reverse=True)
|
||||||
|
loop(pairs, dry=False)
|
||||||
|
|
||||||
def longest_length(li):
|
def longest_length(li):
|
||||||
longest = 0
|
longest = 0
|
||||||
|
|
Loading…
Reference in a new issue