from pprint import pprint
import inquirer
import os
import shutil
def pick():
if a == "{'option': 'Sort Files'}":
def sort():
os.chdir('/home/qz/Downloads')
current = os.getcwd()
files = os.listdir(current)
class col:
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
print(col.OKGREEN,"[Filey] Filey File Organiser V3")
images = [".jpeg",".png",".jpg",".gif"]
text = [".doc",".txt",".pdf",".xlsx",".docx",".xls",".rtf"]
videos = [".mp4",".mkv"]
sounds = [".mp3",".wav",".m4a"]
for file in files:
d = ""
for ex in images:
if file.endswith(ex):
d = '/home/qz/Pictures'
shutil.move(file,d)
print(" [Filey]",file,">>",d)
break
for ex in text:
if file.endswith(ex):
d = '/home/qz/Documents/Text Files'
shutil.move(file,d)
print(" [Filey]",file,">>",d)
break
for ex in sounds:
if file.endswith(ex):
d = '/home/qz/Music'
shutil.move(file,d)
print(" [Filey]",file,">>",d)
break
for ex in videos:
if file.endswith(ex):
d = '/home/qz/Videos'
shutil.move(file,d)
print(" [Filey]",file,">>",d)
break
print(col.OKGREEN,"[Filey] Completed Successfully")
def menu():
questions = [
inquirer.List(
"option",
message="Choose an option",
choices=["Sort Files", "Other"],
),
]
global a
a = inquirer.prompt(questions)
def welcome():
print("this is a welcome message")
def main():
welcome()
menu()
pick()
if __name__ == '__main__':
main()