def __str__(self): if not self.atoms or not self.parameters: return "" s = ["%5d" % i for i in self.atoms] # For exclusions, no type is defined, which equals -1 if self.type != -1: s.append(" %5d " % self.type) # Print integers and floats in proper format and neglect None terms s.extend([FUNC.formatString(i) for i in self.parameters if i is not None]) if self.comments: s.append(';') if type(self.comments) == str: s.append(self.comments) else: s.extend([str(i) for i in self.comments]) return " ".join(s)
def __str__(self): if not self.atoms or not self.parameters: return "" s = ["%5d" % i for i in self.atoms] # For exclusions, no type is defined, which equals -1 if self.type != -1: s.append(" %5d " % self.type) # Print integers and floats in proper format and neglect None terms s.extend( [FUNC.formatString(i) for i in self.parameters if i is not None]) if self.comments: s.append(';') if type(self.comments) == str: s.append(self.comments) else: s.extend([str(i) for i in self.comments]) return " ".join(s)