-
Notifications
You must be signed in to change notification settings - Fork 1
/
runner.py
37 lines (22 loc) · 850 Bytes
/
runner.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
import logging
import logging.config
import sys
import yaml
from utils import get_config
configDict = yaml.load(open('logging-config.yml', 'r'))
logging.config.dictConfig(configDict)
import_logger = logging.getLogger('import_log')
logger = logging.getLogger('console')
if __name__ == '__main__':
config = get_config()
#url = config.get('careerleaf', 'url')
# key_secret = '{}/{}'.format(config.get('careerleaf', 'api_key'), config.get('careerleaf', 'api_secret'))
command = sys.argv[1] if len(sys.argv)>1 else 'undefined'
if command == 'employers':
from employers import importer
importer.run(config)
if command == 'jobseekers-export':
from jobseekers_export import exporter
exporter.run(config)
else:
sys.stderr.write('ERROR: unsupported command: %s\n' % command)