def __setup(self, se): '''Store the raw input for possible later output.''' self.tag_raw = se[0] self.content_raw = se[1] self.comment_raw = se[2] # Parse the rest tag = self.tag_raw[0:-1] value = "".join(se[1]) comment = TxtParser.extract_comment(se[2]) RecordEntry.__init__(self, tag, value, comment)
def __init__(self, se): '''There must be three entries: 1) initial line with tag 2) possible empty list of continue lines (starting with space) 3) possible empty list of comment and / or empty lines. ''' assert len(se) == 3 Encoding.check_unicode(se[0]) self.tag_raw = se[0] Encoding.check_unicode_list(se[1]) self.content_raw = se[1] Encoding.check_unicode_list(se[2]) self.comment_raw = se[2] # Parse the rest tag = self.tag_raw[0:-1] value = "".join(se[1]) comment = TxtParser.extract_comment(se[2]) RecordEntry.__init__(self, tag, value, comment)
def __init__(self, se): '''There must be three entries: 1) initial line with tag 2) possible empty list of continue lines (starting with space) 3) possible empty list of comment and / or empty lines. ''' assert len(se) == 3 Encoding.check_unicode(se[0]) self.tag_raw = se[0] Encoding.check_unicode_list(se[1]) self.content_raw = se[1] Encoding.check_unicode_list(se[2]) self.comment_raw = se[2] # Parse the rest tag = self.tag_raw[0:-1] value = "".join(se[1]) comment = TxtParser.extract_comment(se[2]) RecordEntry.__init__(self, tag, value, comment)