|
|
@ -22,6 +22,10 @@ def organizeFiles():
|
|
|
|
print(key)
|
|
|
|
print(key)
|
|
|
|
|
|
|
|
|
|
|
|
path = paths[input("\nEnter the folder to be organized:")]
|
|
|
|
path = paths[input("\nEnter the folder to be organized:")]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (path == "C:/"):
|
|
|
|
|
|
|
|
print("Cannot make changes to system folder")
|
|
|
|
|
|
|
|
return 0
|
|
|
|
list_files = os.listdir(path)
|
|
|
|
list_files = os.listdir(path)
|
|
|
|
list_extension_names = set([os.path.splitext(file)[1].strip(".") for file in list_files])
|
|
|
|
list_extension_names = set([os.path.splitext(file)[1].strip(".") for file in list_files])
|
|
|
|
#os.path.splitext returns a tuple with file name and extension split
|
|
|
|
#os.path.splitext returns a tuple with file name and extension split
|
|
|
@ -47,14 +51,15 @@ def organizeFiles():
|
|
|
|
if not os.path.exists(path + folder_name + "/" + file):
|
|
|
|
if not os.path.exists(path + folder_name + "/" + file):
|
|
|
|
shutil.move(path + file, path + folder_name + "/" + file)
|
|
|
|
shutil.move(path + file, path + folder_name + "/" + file)
|
|
|
|
print("Moved {} to {}".format(file, path + folder_name))
|
|
|
|
print("Moved {} to {}".format(file, path + folder_name))
|
|
|
|
|
|
|
|
return 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(choice == 1):
|
|
|
|
if(choice == 1):
|
|
|
|
organizeFiles()
|
|
|
|
organizeFiles()
|
|
|
|
elif(choice == 2):
|
|
|
|
elif(choice == 2):
|
|
|
|
pass
|
|
|
|
print("Backup feature not available yet")
|
|
|
|
elif(choice == 3):
|
|
|
|
elif(choice == 3):
|
|
|
|
pass
|
|
|
|
print("Feature to be added soon")
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
print("\nInvalid Choice")
|
|
|
|
print("\nInvalid Choice")
|
|
|
|
|
|
|
|
|
|
|
|