avoid specifying per-family-values for inactive families

This commit is contained in:
Martin Diehl 2018-06-25 13:43:34 +02:00
parent feb6978255
commit f63e8fe34e
2 changed files with 12 additions and 1 deletions

@ -1 +1 @@
Subproject commit c9eed718041d098d7695871c1b123eae950b141d Subproject commit d8ab8056d6245ce42bec8953de9af1d7754867cf

View File

@ -267,3 +267,14 @@ class Material():
if newlen is not oldlen: if newlen is not oldlen:
print('Length of value was changed from %i to %i!'%(oldlen,newlen)) print('Length of value was changed from %i to %i!'%(oldlen,newlen))
def add_value(self, part=None,
section=None,
key=None,
value=None):
if not isinstance(value,list):
if not isinstance(value,str):
value = '%s'%value
value = [value]
print('adding %s:%s:%s with value %s '%(part.lower(),section.lower(),key.lower(),value))
self.data[part.lower()][section.lower()][key.lower()] = value
self.data[part.lower()][section.lower()]['__order__'] += [key.lower()]