merge-related fixes

This commit is contained in:
Martin Diehl 2018-08-03 19:30:36 +02:00
parent 2da5d0029c
commit c8aa9ff3ef
2 changed files with 14 additions and 1 deletions

@ -1 +1 @@
Subproject commit 9d3b6c858243ec6d7c1f8425e78be59bfdd6e110
Subproject commit ae79bc96d9dd1fd5ea06b916b0be098169f34a1e

View File

@ -277,3 +277,16 @@ class Material():
self.data[part.lower()][section.lower()][key.lower()] = value
if newlen is not oldlen:
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()]