Compare commits
3 commits
74fe75eea0
...
e016083f1c
Author | SHA1 | Date | |
---|---|---|---|
e016083f1c | |||
33ea029c37 | |||
010c555e5a |
1 changed files with 9 additions and 3 deletions
12
main.py
12
main.py
|
@ -70,18 +70,24 @@ def main():
|
|||
extension: str = file.rpartition(".")[-1] or ""
|
||||
if extension != "":
|
||||
extension = "." + extension
|
||||
newname = input("New name: ")
|
||||
newname = input("Enter new name: ")
|
||||
else:
|
||||
newname = file
|
||||
if args.classify:
|
||||
category: str = input("Category: ")
|
||||
if not os.path.exists(outputFolder + category) or not os.path.isdir(
|
||||
print(f"Existing categories: {os.listdir(outputFolder)}")
|
||||
category: str = input("Enter category or delete to permanently delete file: ")
|
||||
if category == "delete":
|
||||
os.remove(inputFolder + file)
|
||||
elif not os.path.exists(outputFolder + category) or not os.path.isdir(
|
||||
outputFolder + category
|
||||
):
|
||||
os.mkdir(outputFolder + category)
|
||||
else:
|
||||
category: str = ""
|
||||
path: str = outputFolder + category + "/" + newname + extension
|
||||
if os.path.exists(path):
|
||||
newname = input("Name already in use, please enter another name: ")
|
||||
path = outputFolder + category + "/" + newname + extension
|
||||
shutil.move(inputFolder + file, path)
|
||||
if args.reformat:
|
||||
if extension != ".mp4":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue