diff options
author | 2018-02-09 16:34:19 -0800 | |
---|---|---|
committer | 2018-02-09 16:34:19 -0800 | |
commit | 3ff08a6163628b7483f1babc280adbea41c8e7ac (patch) | |
tree | 2f448d12cf3d64f7ace420e8dfc9feabe64c36c2 /Python/pywarpx/Bucket.py | |
parent | ec6dd873d46a87707c20aa09b58c691d37a36f98 (diff) | |
download | WarpX-3ff08a6163628b7483f1babc280adbea41c8e7ac.tar.gz WarpX-3ff08a6163628b7483f1babc280adbea41c8e7ac.tar.zst WarpX-3ff08a6163628b7483f1babc280adbea41c8e7ac.zip |
Updated to match changes in the PICMI standard
Diffstat (limited to 'Python/pywarpx/Bucket.py')
-rw-r--r-- | Python/pywarpx/Bucket.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Python/pywarpx/Bucket.py b/Python/pywarpx/Bucket.py index 5c429f530..960fe2108 100644 --- a/Python/pywarpx/Bucket.py +++ b/Python/pywarpx/Bucket.py @@ -28,7 +28,12 @@ class Bucket(object): for attr, value in iteritems(self.argvattrs): # --- repr is applied to value so that for floats, all of the digits are included. # --- The strip is then needed when value is a string. - attrstring = '{0}.{1}={2} '.format(self.instancename, attr, repr(value).strip("'\"")) + if hasattr(value, '__iter__'): + # --- For lists, tuples, and arrays make a space delimited string of the values + rhs = ' '.join(map(repr, value)) + else: + rhs = value + attrstring = '{0}.{1}={2}'.format(self.instancename, attr, repr(rhs).strip("'\"")) result += [attrstring] return result |