def to_string(self): s = TxtParser.add_newlines(self.comment_raw) for l in self: # There is the need to check for the type: only the # TxtRecordEntry provides a (for this method) usable # output. if isinstance(l, TxtRecordEntry): s += l.to_string() else: # If this is another RecordEntry, at least get some # infos from this. s += TxtRecordEntry.format_entry(l) return s
def to_string(self): s = TxtParser.add_newlines(self.comment_raw) for l in self: # There is the need to check for the type: only the # TxtRecordEntry provides a (for this method) usable # output. if isinstance(l, TxtRecordEntry): s += l.to_string() else: # If this is another RecordEntry, at least get some # infos from this. s += TxtRecordEntry.format_entry(l) return s
def to_string(self): """Return the entry as a string""" add_content = TxtParser.add_newlines(self.content_raw) add_comment = TxtParser.add_newlines(self.comment_raw) return self.tag_raw + add_content + add_comment
def to_string(self): """Return the entry as a string""" add_content = TxtParser.add_newlines(self.content_raw) add_comment = TxtParser.add_newlines(self.comment_raw) return self.tag_raw + add_content + add_comment
def to_string(self): add_content = TxtParser.add_newlines(self.content_raw) add_comment = TxtParser.add_newlines(self.comment_raw) r = self.tag_raw + add_content + add_comment return r