fixes in secop_psi/sea.py

is_running parameter
This commit is contained in:
zolliker 2022-04-20 15:52:43 +02:00
parent 1da7657483
commit 774f33122a

View File

@ -406,7 +406,9 @@ class SeaModule(Module):
# with open(join(seaconfdir, json_file + '.json')) as fp:
# sea_object, descr = json.load(fp)
with open(join(seaconfdir, json_file)) as fp:
descr = json.load(fp)[sea_object]
content = json.load(fp)
# print(json_file, content.keys())
descr = content[sea_object]
if rel_paths == '*' or not rel_paths:
# take all
main = descr['params'][0]
@ -419,13 +421,14 @@ class SeaModule(Module):
# filter by relative paths
rel_paths = rel_paths.split()
result = []
is_running = None
for rpath in rel_paths:
include = True
for paramdesc in descr['params']:
path = paramdesc['path']
if path.endswith('is_running'):
# take this always
result.append(paramdesc)
is_running = paramdesc
continue
if paramdesc.get('visibility', 1) > visibility_level:
continue
@ -437,6 +440,8 @@ class SeaModule(Module):
result.append(paramdesc)
elif sub[0] == rpath:
result.append(paramdesc)
if is_running: # take this at end
result.append(is_running)
descr['params'] = result
rel0 = '' if rel_paths[0] == '.' else rel_paths[0]
if result[0]['path'] == rel0: