From c8aa9ff3efe0b1ebd09fd61e85000be030d4c0b1 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 3 Aug 2018 19:30:36 +0200 Subject: [PATCH] merge-related fixes --- PRIVATE | 2 +- lib/damask/config/material.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index 9d3b6c858..ae79bc96d 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 9d3b6c858243ec6d7c1f8425e78be59bfdd6e110 +Subproject commit ae79bc96d9dd1fd5ea06b916b0be098169f34a1e diff --git a/lib/damask/config/material.py b/lib/damask/config/material.py index af635dd92..02658019d 100644 --- a/lib/damask/config/material.py +++ b/lib/damask/config/material.py @@ -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()]