website/import_mess/remove_zpadding_images_names.py

19 lines
327 B
Python
Raw Normal View History

2022-09-28 21:43:45 +00:00
#!/bin/python3
# remove z padding in files
import os
CONTENT_DIR = '../content/images/'
images_dirs = os.listdir(CONTENT_DIR)
for dir in images_dirs:
# remove z padding
try:
id = int(dir)
except ValueError:
continue
if dir != id:
os.rename(CONTENT_DIR + dir, CONTENT_DIR + str(id))