|
@ -1,9 +1,9 @@ |
|
|
import os |
|
|
import os, glob |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main(): |
|
|
def main(): |
|
|
|
|
|
|
|
|
exts = ('.jpg', '.webm', '.png', '.mp4', '.gif', '.pdf', '.odt') |
|
|
exts = ('.jpg', '.webm', '.png', '.mp4', '.gif') |
|
|
|
|
|
|
|
|
print("The Source directory is " + os.getcwd()) |
|
|
print("The Source directory is " + os.getcwd()) |
|
|
newdir = str(input("Please enter a directory:")) |
|
|
newdir = str(input("Please enter a directory:")) |
|
@ -18,6 +18,10 @@ def main(): |
|
|
print("Directory found " + os.getcwd()) |
|
|
print("Directory found " + os.getcwd()) |
|
|
# file_list=glob.glob('*.png') #checks to see if files are in directory, asks user if they look familiar |
|
|
# file_list=glob.glob('*.png') #checks to see if files are in directory, asks user if they look familiar |
|
|
frecognize(directory, exts) |
|
|
frecognize(directory, exts) |
|
|
|
|
|
frename(exts, directory) |
|
|
|
|
|
#frecognize(directory, exts) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def frecognize(directory, exts): |
|
|
def frecognize(directory, exts): |
|
@ -31,13 +35,22 @@ def frecognize(directory, exts): |
|
|
#i += 1 |
|
|
#i += 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def frename(directory): |
|
|
def frename(exts, directory): |
|
|
str(oldname) |
|
|
filename=[] |
|
|
|
|
|
source = directory + filename |
|
|
newname = str(input("Please enter the new filename: ")) |
|
|
newname = str(input("Please enter the new filename: ")) |
|
|
|
|
|
index = 0 |
|
|
|
|
|
for filename in os.listdir(directory): |
|
|
|
|
|
if glob.glob('*.png') == 1: |
|
|
|
|
|
pngname = newname + "_" + str(index + 1) + ".png" |
|
|
|
|
|
os.rename(filename, pngname) |
|
|
|
|
|
|
|
|
|
|
|
elif glob.glob('*jpg') == 1: |
|
|
|
|
|
os.rename(folder, newname + "_" + str(index + 1) + ".jpg") |
|
|
|
|
|
|
|
|
for file in os.listdir(directory) |
|
|
|
|
|
|
|
|
|
|
|
main() |
|
|
main() |
|
|
|
|
|
|
|
|
# todo add gui |
|
|
# todo add gui |
|
|
# todo make frecognize do what the fuck I want it to (print x amount of files) |
|
|
# todo make frecognize do what I want it to (print x amount of files) |
|
|
|
|
|
|
|
|