def __str__( self ): " Converts to string " return "CML record: " + Fragment.__str__( self ) + \ "\nBody:\n" + "\n".join( [ str( item ) for item in self.parts ] )
def niceStringify( self, level ): " Returns a string representation with new lines and shifts " joiner = "\n" + ( level + 1 ) * " " return level * " " + "CML record: " + Fragment.__str__( self ) + \ joiner + joiner.join( [ str( item ) for item in self.parts ] )