Selaa lähdekoodia

Merge branch '69-fix-pipeline-execution' into 'master'

Resolve "fix pipeline execution"

Closes #69

See merge request troebs/pycs!65
Eric Tröbs 4 vuotta sitten
vanhempi
commit
e10c99fc80
2 muutettua tiedostoa jossa 5 lisäystä ja 9 poistoa
  1. 4 4
      pycs/pipeline/PipelineManager.py
  2. 1 5
      pycs/projects/ProjectManager.py

+ 4 - 4
pycs/pipeline/PipelineManager.py

@@ -7,16 +7,16 @@ from pycs.projects.Project import Project
 
 
 class PipelineManager:
-    def __init__(self, project: Project, pipeline):
-        code_path = path.join(pipeline['path'], pipeline['code']['module'])
+    def __init__(self, project: Project):
+        code_path = path.join(project['model']['path'], project['model']['code']['module'])
         module_name = code_path.replace('/', '.').replace('\\', '.')
-        class_name = pipeline['code']['class']
+        class_name = project['model']['code']['class']
 
         mod = __import__(module_name, fromlist=[class_name])
         cl = getattr(mod, class_name)
 
         self.project = project
-        self.pipeline = cl(pipeline['path'], pipeline)
+        self.pipeline = cl(project['model']['path'], project['model'])
 
     def close(self):
         self.pipeline.close()

+ 1 - 5
pycs/projects/ProjectManager.py

@@ -103,11 +103,7 @@ class ProjectManager(ObservableDict):
 
         # create pipeline if it does not exist already
         if self.pipeline_manager is None:
-            # abort if pipeline id is no valid key
-            pipeline_identifier = project['pipeline']['model-distribution']
-            pipeline = self.parent['models'][pipeline_identifier]
-
-            self.pipeline_manager = PipelineManager(project, pipeline)
+            self.pipeline_manager = PipelineManager(project)
 
         # run jobs
         for file_id in identifiers: