main.py
1.14 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
from pymongo import MongoClient
client = MongoClient()
db = client['ImgSystem']
def help():
print "s: Scan"
print "c: Compare"
print "a: Analyse"
print "p: Pipeline"
print "q: Quit"
print "h: Help"
def choose_operation():
print "Please enter the type of operation (enter h for help)"
operation = raw_input()
if operation == "s":
pass
elif operation == "c":
print "Please enter the allowed domain:"
allowed_domain = raw_input()
print "Please enter the url of the first image"
url1 = raw_input()
print "Please enter the index of the first image"
idx1 = raw_input()
print "Please enter the url of the second image"
url2 = raw_input()
print "Please enter the index of the second image"
idx2 = raw_input()
elif operation == "a":
print "Please enter the allowed domain:"
allowed_domain = raw_input()
print "Please enter the url of the image"
url = raw_input()
print "Please enter the index of the image"
idx = raw_input()
elif operation == "p":
pass
elif operation == "q":
return 1
elif operation == "h":
help()
else:
print "Invalid operation"
return 0
flag = 0
while not flag:
flag = choose_operation()