formats/v1: extract source loading code
Extract the code that loads individual source into its own function.
This commit is contained in:
parent
598cfd0d76
commit
3b7141417c
1 changed files with 7 additions and 3 deletions
|
|
@ -114,6 +114,11 @@ def load_stage(description: Dict, index: Index, pipeline: Pipeline):
|
||||||
ip.add_reference(commit, options)
|
ip.add_reference(commit, options)
|
||||||
|
|
||||||
|
|
||||||
|
def load_source(name: str, description: Dict, index: Index, manifest: Manifest):
|
||||||
|
info = index.get_module_info("Source", name)
|
||||||
|
manifest.add_source(info, description)
|
||||||
|
|
||||||
|
|
||||||
def load_pipeline(description: Dict, index: Index, manifest: Manifest, n: int = 0) -> Pipeline:
|
def load_pipeline(description: Dict, index: Index, manifest: Manifest, n: int = 0) -> Pipeline:
|
||||||
build = description.get("build")
|
build = description.get("build")
|
||||||
if build:
|
if build:
|
||||||
|
|
@ -155,9 +160,8 @@ def load(description: Dict, index: Index) -> Manifest:
|
||||||
load_assembler(assembler, index, manifest)
|
load_assembler(assembler, index, manifest)
|
||||||
|
|
||||||
# load the sources
|
# load the sources
|
||||||
for name, options in sources.items():
|
for name, desc in sources.items():
|
||||||
info = index.get_module_info("Source", name)
|
load_source(name, desc, index, manifest)
|
||||||
manifest.add_source(info, options)
|
|
||||||
|
|
||||||
for pipeline in manifest.pipelines.values():
|
for pipeline in manifest.pipelines.values():
|
||||||
for stage in pipeline.stages:
|
for stage in pipeline.stages:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue