-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
29 lines (21 loc) · 656 Bytes
/
run.py
File metadata and controls
29 lines (21 loc) · 656 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
import json
import os
import logging
from FPMatch import Watcher
import LoggerClass
LoggerClass.Logger()
logger = logging.getLogger(__name__)
def run():
with open('config.json', 'r') as f:
config = json.load(f)
if not os.path.exists(config['input']):
logger.info(f'Creating {config["input"]}')
os.mkdir(config['input'])
if not os.path.exists(config['output']):
logger.info(f'Creating {config["output"]}')
os.mkdir(config['output'])
w = Watcher(inpath=config['input'], outpath=config['output'])
logger.info(f'Monitoring {config["input"]}')
w.run()
if __name__ == '__main__':
run()