This repository was archived by the owner on Aug 30, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +26
-7
lines changed
templates/pc_templates/some_subdir Expand file tree Collapse file tree 2 files changed +26
-7
lines changed Original file line number Diff line number Diff line change @@ -51,28 +51,47 @@ def filter_func(name):
5151 return False
5252
5353
54- def get_template_undef ( tpl_name ):
55- """Find out placeholders of a template
54+ def get_path_from_pc_name ( pc_name ):
55+ """Find out path of a template
5656
5757 Parameters
5858 ----------
59- tpl_name : string
59+ pc_name : string
6060 Name of template.
6161
6262 Returns
6363 -------
64- undef : list
65- List of placeholders of template
64+ tplPath : string
65+ Path of template
6666
6767 """
6868
69- tplPath = tpl_name + '.json'
69+ tplPath = pc_name + '.json'
7070
7171 # change path to template if in subdir
7272 for i in pcTplEnv .list_templates (filter_func = filter_func ):
7373 if i .split ('/' )[- 1 ] == tplPath :
7474 tplPath = i
7575
76+ return tplPath
77+
78+
79+ def get_template_undef (pc_name ):
80+ """Find out placeholders of a template
81+
82+ Parameters
83+ ----------
84+ pc_name : string
85+ Name of template.
86+
87+ Returns
88+ -------
89+ undef : list
90+ List of placeholders of template
91+
92+ """
93+ tplPath = get_path_from_pc_name (pc_name )
94+
7695 # find variables from processchain and render template with variables
7796 tpl_source = pcTplEnv .loader .get_source (pcTplEnv , tplPath )[0 ]
7897 parsed_content = pcTplEnv .parse (tpl_source )
@@ -83,7 +102,7 @@ def get_template_undef(tpl_name):
83102
84103def render_template (pc ):
85104
86- tplPath = pc + '.json'
105+ tplPath = get_path_from_pc_name ( pc )
87106
88107 undef = get_template_undef (pc )
89108
File renamed without changes.
You can’t perform that action at this time.
0 commit comments