|
|
@ -64,13 +64,15 @@ if __name__ == '__main__' :
|
|
|
|
args['dbname'] = SYS_ARGS['db']
|
|
|
|
args['dbname'] = SYS_ARGS['db']
|
|
|
|
|
|
|
|
|
|
|
|
elif SYS_ARGS ['store'] == 'mongo':
|
|
|
|
elif SYS_ARGS ['store'] == 'mongo':
|
|
|
|
args = {'host':SYS_ARGS['host']if 'host' in SYS_ARGS else 'localhost:27217'}
|
|
|
|
args = {'host':SYS_ARGS['host']if 'host' in SYS_ARGS else 'localhost:27017'}
|
|
|
|
if SYS_ARGS['store'] in ['mongo','couch']:
|
|
|
|
if SYS_ARGS['store'] in ['mongo','couch']:
|
|
|
|
args['dbname'] = SYS_ARGS['db'] if 'db' in SYS_ARGS else 'claims_outcomes'
|
|
|
|
args['dbname'] = SYS_ARGS['db'] if 'db' in SYS_ARGS else 'claims_outcomes'
|
|
|
|
args['doc'] = CONTEXT
|
|
|
|
args['doc'] = CONTEXT
|
|
|
|
|
|
|
|
|
|
|
|
TYPE = TYPE[SYS_ARGS['store']]
|
|
|
|
TYPE = TYPE[SYS_ARGS['store']]
|
|
|
|
writer = factory.instance(type=TYPE,args=args)
|
|
|
|
writer = factory.instance(type=TYPE,args=args)
|
|
|
|
|
|
|
|
if SYS_ARGS['store'] == 'disk':
|
|
|
|
|
|
|
|
writer.init(path = 'output-claims.json')
|
|
|
|
logger = factory.instance(type=TYPE,args= dict(args,**{"doc":"logs"}))
|
|
|
|
logger = factory.instance(type=TYPE,args= dict(args,**{"doc":"logs"}))
|
|
|
|
files = os.listdir(SYS_ARGS['folder'])
|
|
|
|
files = os.listdir(SYS_ARGS['folder'])
|
|
|
|
CONFIG = json.loads(open(SYS_ARGS['config']).read())
|
|
|
|
CONFIG = json.loads(open(SYS_ARGS['config']).read())
|
|
|
@ -90,10 +92,12 @@ if __name__ == '__main__' :
|
|
|
|
logs = [{"filename":filename,"msg":e.message}]
|
|
|
|
logs = [{"filename":filename,"msg":e.message}]
|
|
|
|
content = None
|
|
|
|
content = None
|
|
|
|
if content :
|
|
|
|
if content :
|
|
|
|
writer.write(row= content)
|
|
|
|
|
|
|
|
|
|
|
|
writer.write(content)
|
|
|
|
if logs:
|
|
|
|
if logs:
|
|
|
|
|
|
|
|
|
|
|
|
logger.write(row=logs)
|
|
|
|
logger.write(logs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|