diff options
Diffstat (limited to 'Python/pywarpx/Bucket.py')
-rw-r--r-- | Python/pywarpx/Bucket.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Python/pywarpx/Bucket.py b/Python/pywarpx/Bucket.py index 960fe2108..cd5c81793 100644 --- a/Python/pywarpx/Bucket.py +++ b/Python/pywarpx/Bucket.py @@ -26,14 +26,18 @@ class Bucket(object): "Concatenate the attributes into a string" result = [] for attr, value in iteritems(self.argvattrs): + if value is None: + continue # --- 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. - if hasattr(value, '__iter__'): + if isinstance(value, str): + rhs = value + elif 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("'\"")) + attrstring = '{0}.{1} = {2}'.format(self.instancename, attr, repr(rhs).strip("'\"")) result += [attrstring] return result |