-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.py
More file actions
82 lines (73 loc) · 2.95 KB
/
Main.py
File metadata and controls
82 lines (73 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
from Download import *
from queue import Queue
from Sorting import *
from DribbbleStorage import *
import time
def make_menu():
# Greeting
print("====== Dribbble Queue ======")
print("*****************************")
print("* Home Page *")
print("*****************************")
# Directory Info
print("*** Note: Image will be saved in directory named by current date.")
# Top Menu
print("--- a: Daily Top 10")
print("--- b: Daily Top 10 by tags")
print("--- c: Download all images")
print("--- q: Exit")
top_in = input("--- Enter the letter of the function: ")
while top_in != 'a' and top_in != 'b' and top_in != 'c' and top_in != 'q':
print("*** Warning: Invalid Command!")
top_in = input("--- Enter the letter of the function: ")
# Command
return top_in
if __name__ == '__main__':
print("****** Program instantiate... ******")
time.sleep(2)
factory = Factory()
hidden = os.system('clear')
print(' ______ _______ _________ ______ ______ ______ _ _______ \n'
'( __ \ ( ____ )\__ __/( ___ \ ( ___ \ ( ___ \ ( \ ( ____ \ \n'
'| ( \ )| ( )| ) ( | ( ) )| ( ) )| ( ) )| ( | ( \/\n'
'| | ) || (____)| | | | (__/ / | (__/ / | (__/ / | | | (__ \n'
'| | | || __) | | | __ ( | __ ( | __ ( | | | __) \n'
'| | ) || (\ ( | | | ( \ \ | ( \ \ | ( \ \ | | | ( \n'
'| (__/ )| ) \ \_____) (___| )___) )| )___) )| )___) )| (____/\| (____/\ \n'
'(______/ |/ \__/\_______/|/ \___/ |/ \___/ |/ \___/ (_______/(_______/\n')
command = make_menu()
while command != 'q':
if command == 'a':
factory.extracting()
hidden = os.system('clear')
print("======== Work Done! ======")
factory.report_top()
os.chdir('..')
command = make_menu()
elif command == 'b':
raw_in = input("--- Enter something you are interested in, separate by comma: ")
raw_tags = raw_in.split(',')
tags = []
for tag in raw_tags:
tags.append(tag.strip())
print("====== Tags Received ======")
time.sleep(2)
factory.add_tag_set(tags)
factory.extracting()
hidden = os.system('clear')
print("====== Work Done! ======")
factory.report_top()
os.chdir('..')
command = make_menu()
elif command == 'c':
print("====== Note: This function might take several minutes ======")
time.sleep(2)
factory.download_all()
hidden = os.system('clear')
print("====== Work Done! ======")
os.chdir('..')
command = make_menu()
print("******* Now Exit! Thanks for using!")
time.sleep(2)
hidden = os.system('clear')
exit(0)