Skip to content
Snippets Groups Projects
Commit 2137db7f authored by Stefano Borini's avatar Stefano Borini
Browse files

Setting the appropriate driver in case of run_datasource being specified

parent ec4879e0
No related branches found
No related tags found
1 merge request!162Provide ability to run a single data source and check its results [WIP]
......@@ -6,8 +6,9 @@ from stevedore.exception import NoMatches
from envisage.api import Application
from envisage.core_plugin import CorePlugin
from traits.api import Unicode, Bool
from traits.api import Unicode, Bool, Either
from force_bdss.core_run_datasource_driver import CoreRunDataSourceDriver
from .factory_registry_plugin import FactoryRegistryPlugin
from .core_evaluation_driver import CoreEvaluationDriver
from .core_mco_driver import CoreMCODriver
......@@ -28,13 +29,23 @@ class BDSSApplication(Application):
#: coordination of the MCO itself. See design notes for more details.
evaluate = Bool()
def __init__(self, evaluate, workflow_filepath):
#: This entry, if not None, drives the evaluator to run a single
#: data source in the workflow. It accepts input parameters on standard
#: input and returns the output to standard output.
run_datasource = Either(Unicode(), None)
def __init__(self, evaluate, run_datasource, workflow_filepath):
self.evaluate = evaluate
self.run_datasource = run_datasource
self.workflow_filepath = workflow_filepath
plugins = [CorePlugin(), FactoryRegistryPlugin()]
if self.evaluate:
if self.run_datasource:
plugins.append(CoreRunDataSourceDriver(
run_datasource=run_datasource
))
elif self.evaluate:
plugins.append(CoreEvaluationDriver())
else:
plugins.append(CoreMCODriver())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment