Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.

Commit 1e76204

Browse files
committed
re-enable subdirs for templates
1 parent 0c6ffe3 commit 1e76204

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

actinia_gdi/core/gmodulesActinia.py

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff 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

84103
def render_template(pc):
85104

86-
tplPath = pc + '.json'
105+
tplPath = get_path_from_pc_name(pc)
87106

88107
undef = get_template_undef(pc)
89108

actinia_gdi/templates/pc_templates/index_NDVI.json renamed to actinia_gdi/templates/pc_templates/some_subdir/index_NDVI.json

File renamed without changes.

0 commit comments

Comments
 (0)