branch develop: recent changes from branch wip

Change-Id: I2e1173423f2aa164a8a7158921b354c2aff1ab2c
This commit is contained in:
2023-06-20 10:57:27 +02:00
parent fcca3801a4
commit 87830a1473
18 changed files with 238 additions and 119 deletions

View File

@ -383,6 +383,19 @@ SEA_TO_SECOPTYPE = {
}
class SeaEnum(EnumType):
"""some sea enum nodes have text type -> accept '<integer>' also"""
def copy(self):
return SeaEnum(self._enum)
def __call__(self, value):
try:
value = int(value)
except TypeError:
pass
return super().__call__(value)
def get_datatype(paramdesc):
typ = paramdesc['type']
result = SEA_TO_SECOPTYPE.get(typ, False)
@ -390,7 +403,7 @@ def get_datatype(paramdesc):
return result
# special cases
if typ == 'enum':
return EnumType(paramdesc['enum'])
return SeaEnum(paramdesc['enum'])
raise ValueError('unknown SEA type %r' % typ)
@ -492,9 +505,7 @@ class SeaModule(Module):
raise ConfigError(f"{sea_object}/{paramdesc['path']} is not writable")
paramdesc['key'] = 'target'
paramdesc['readonly'] = False
extra_module_set = cfgdict.pop('extra_modules', ())
if extra_module_set:
extra_module_set = set(extra_module_set.replace(',', ' ').split())
extra_module_set = set(cfgdict.pop('extra_modules', ()))
path2param = {}
attributes = {'sea_object': sea_object, 'path2param': path2param}