- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFullyAutoCheckScript_debug.py
More file actions
Latest commit
40 lines (38 loc) · 1.18 KB
/
Copy pathFullyAutoCheckScript_debug.py
File metadata and controls
40 lines (38 loc) · 1.18 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
fromdatetimeimportdatetime, timedelta
defgetLastDate(day=1):
return((datetime.today() -timedelta(days=day)).strftime('%Y-%m-%d'))
defreadConfig():
try:
globalAutomation, iSMART_PATH
withopen('configuration.txt') asrconf:
foreach_lineinrconf.read().split('\n'):
ifisfile(each_line):
Automation=each_line
elifisdir(each_line):
iSMART_PATH=each_line
logger.info('Read the file: "configuration.txt" to define varibles.')
exceptIOErrorasioerr:
logger.error(str(ioerr))
try:
exe_round, d_list=1, [getLastDate(3), getLastDate(2), getLastDate(1)]
while(1):
readConfig()
yesterday=d_list[exe_round-1]
if'Automation'notinglobals():
Automation=getProgram('^Recording_log_check_Tool_for_vast_\w+', Desktop)
if'iSMART_PATH'notinglobals():
iSMART_PATH=getProgram('^iSMART\w+', r'C:\Program Files (x86)\VIVOTEK Inc')
...
...
...
exe_round=exe_round+1
ifexe_round==len(d_list):
break
sleep(10)
exceptException:
print('', end='')
exceptFileNotFoundErrorasferr:
logger.error(str(ferr))
exceptKeyboardInterrupt:
logger.info('\nUser press Ctrl+C to exit.')
sleep(2)