-
Notifications
You must be signed in to change notification settings - Fork 1
/
client.py
54 lines (43 loc) · 1.33 KB
/
client.py
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
from datetime import datetime
defaultLogics = {
'hasDollar':None,
'hasItem':None,
'hasSection':None,
}
def userInput():
keywords = []
keyword = ''
while(keyword != 'NEXT'):
keyword = input('please enter the keyword (type NEXT to move on): ')
if keyword == 'NEXT':
continue
# some validation here
elif False:
pass
else:
keywords.append(keyword)
date = []
while(date == []):
entries = []
entries.append(input('please enter the start date (yyyy-mm-dd):'))
entries.append(input('please enter the end date (yyyy-mm-dd):'))
try:
for e in entries:
date.append(datetime.strptime(date,'%Y-%m-%d'))
except:
date = []
print('Invalidate date format. Please try again.')
user_logics = {}
for k,c in defaultLogics.items():
tempholder = input(f'Do you need a {k} value (True/False):')
if tempholder =='True':
logic = True
else:
logic = False
user_logics[k] = logic
return keywords, date, user_logics
def userSearch(keywords,date = datetime.today(),logics = defaultLogics):
pass
#time
if __name__ == '__main__':
print(userInput())