-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
executable file
·31 lines (25 loc) · 922 Bytes
/
Copy pathmain.py
File metadata and controls
executable file
·31 lines (25 loc) · 922 Bytes
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
#!/opt/homebrew/bin/python3
import os
import sys
import argparse
import configparser
from datetime import datetime
from modules.schedulerModule import InoutScheduler
def configInit(configName):
configPth = os.path.join(configName)
config = configparser.ConfigParser()
config.read(configPth)
return config
if __name__ == '__main__':
parser = argparse.ArgumentParser()
defaultConfigPth = os.path.join(os.path.split(
os.path.realpath(__file__))[0], 'catchCashFlow.cfg')
nowTime = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
print('['+nowTime+']'+' Load config file at '+defaultConfigPth)
sys.stdout.flush()
parser.add_argument('--config-pth', type=str, default=defaultConfigPth,
help='Config file path')
args = parser.parse_args()
config = configInit(args.config_pth)
scheduler = InoutScheduler(config)
scheduler.startScheduler()