From 2b0e6654e0c60ec1193f7c0f15f005ea89ef62d8 Mon Sep 17 00:00:00 2001 From: Castro0o Date: Tue, 18 Feb 2020 21:49:17 +0100 Subject: [PATCH] small corrections to def reorder_imgs --- functions.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/functions.py b/functions.py index b7b9035..f938d24 100644 --- a/functions.py +++ b/functions.py @@ -125,11 +125,10 @@ def listimgs(dir): def reorder_imgs(dir, dry): # does zero pad file numbers - + # and returns correct order of files lsimgs = listimgs(dir) for img in lsimgs: img_name, img_ext = os.path.splitext(img) - print(img) # does file follow \d{1,}\.img_ext numb_exp = re.compile( r'(?P.*?)(?P\d+)(?P%s)'% re.escape(img_ext)) @@ -151,6 +150,5 @@ def reorder_imgs(dir, dry): print(f'Renaming: {img} >>>>> {new_img}') if dry == False: os.replace(src_img, dst_img) - lsimgs = listimgs(dir) # update list w/ renamed imgs - return listimgs(dir) + return listimgs(dir) # update list w/ renamed imgs