Make noext, ext from the file basename instead of whole path.

This commit is contained in:
voussoir 2019-12-12 12:15:57 -08:00
parent f40f41b62a
commit 514af31c18

View file

@ -35,9 +35,9 @@ def brename(transformation, autoyes=False, recurse=False):
news = []
for (index, x) in enumerate(olds):
(noext, ext) = os.path.splitext(x)
directory = os.path.dirname(x)
basename = os.path.basename(x)
(noext, ext) = os.path.splitext(basename)
x = basename
x = eval(transformation)
x = os.path.join(directory, x)