From 514af31c18a8e4a655f6761b3104c41bfc1cf3e0 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 12 Dec 2019 12:15:57 -0800 Subject: [PATCH] Make noext, ext from the file basename instead of whole path. --- brename.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brename.py b/brename.py index c5e946b..f889999 100644 --- a/brename.py +++ b/brename.py @@ -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)