diff --git a/lib/damask/asciitable.py b/lib/damask/asciitable.py index fddd21f42..b332c88d0 100644 --- a/lib/damask/asciitable.py +++ b/lib/damask/asciitable.py @@ -66,6 +66,14 @@ class ASCIItable(): except: return 0.0 +# ------------------------------------------------------------------ + def _noCRLF(self, + string): + try: + return string.replace('\n','').replace('\r','') + except: + return string + # ------------------------------------------------------------------ def close(self, dismiss = False): @@ -243,9 +251,9 @@ class ASCIItable(): try: for item in what: self.labels_append(item) except: - self.labels += [str(what)] + self.labels += [self._noCRLF(str(what))] else: - self.labels += [what] + self.labels += [self._noCRLF(what)] self.__IO__['labeled'] = True # switch on processing (in particular writing) of labels if reset: self.__IO__['labels'] = list(self.labels) # subsequent data_read uses current labels as data size @@ -372,9 +380,9 @@ class ASCIItable(): try: for item in what: self.info_append(item) except: - self.info += [str(what)] + self.info += [self._noCRLF(str(what))] else: - self.info += [what] + self.info += [self._noCRLF(what)] # ------------------------------------------------------------------ def info_clear(self):