Handle prototype modules with non-dicts as global variables
This commit is contained in:
parent
3b75780b40
commit
52c84b44b5
1 changed files with 4 additions and 3 deletions
|
|
@ -107,9 +107,10 @@ for mod in settings.PROTOTYPE_MODULES:
|
||||||
# internally we store as (key, desc, locks, tags, prototype_dict)
|
# internally we store as (key, desc, locks, tags, prototype_dict)
|
||||||
prots = []
|
prots = []
|
||||||
for variable_name, prot in all_from_module(mod).items():
|
for variable_name, prot in all_from_module(mod).items():
|
||||||
if "prototype_key" not in prot:
|
if isinstance(prot, dict):
|
||||||
prot['prototype_key'] = variable_name.lower()
|
if "prototype_key" not in prot:
|
||||||
prots.append((prot['prototype_key'], homogenize_prototype(prot)))
|
prot['prototype_key'] = variable_name.lower()
|
||||||
|
prots.append((prot['prototype_key'], homogenize_prototype(prot)))
|
||||||
# assign module path to each prototype_key for easy reference
|
# assign module path to each prototype_key for easy reference
|
||||||
_MODULE_PROTOTYPE_MODULES.update({prototype_key.lower(): mod for prototype_key, _ in prots})
|
_MODULE_PROTOTYPE_MODULES.update({prototype_key.lower(): mod for prototype_key, _ in prots})
|
||||||
# make sure the prototype contains all meta info
|
# make sure the prototype contains all meta info
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue