Commit 1913f25b authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

store app.logger in Simulation class instance.

parent bc1669f7
......@@ -112,7 +112,7 @@ def _runSimulation(parameter_dict, queue):
klass_name = 'dream.simulation.%s' % \
parameter_dict['general']['simulationClass']
klass = __import__(klass_name, globals(), {}, klass_name)
result = klass.Simulation().run(parameter_dict)
result = klass.Simulation(logger=app.logger).run(parameter_dict)
queue.put(dict(success=json.loads(result)))
except Exception, e:
tb = traceback.format_exc()
......
......@@ -2,5 +2,8 @@ import json
from dream.simulation.LineGenerationJSON import main as simulate_line_json
class Simulation:
def __init__(self, logger=None):
self.logger = logger
def run(self, data):
return simulate_line_json(input_data=json.dumps(data))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment