Code Duplication    Length = 22-22 lines in 2 locations

src/ocrd_models/ocrd_page_generateds.py 2 locations

@@ 7468-7489 (lines=22) @@
7465
            outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
7466
        else:
7467
            outfile.write('/>%s' % (eol_, ))
7468
    def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='UnorderedGroupType'):
7469
        if self.id is not None and 'id' not in already_processed:
7470
            already_processed.add('id')
7471
            outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
7472
        if self.regionRef is not None and 'regionRef' not in already_processed:
7473
            already_processed.add('regionRef')
7474
            outfile.write(' regionRef=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.regionRef), input_name='regionRef')), ))
7475
        if self.caption is not None and 'caption' not in already_processed:
7476
            already_processed.add('caption')
7477
            outfile.write(' caption=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.caption), input_name='caption')), ))
7478
        if self.type_ is not None and 'type_' not in already_processed:
7479
            already_processed.add('type_')
7480
            outfile.write(' type=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.type_), input_name='type')), ))
7481
        if self.continuation is not None and 'continuation' not in already_processed:
7482
            already_processed.add('continuation')
7483
            outfile.write(' continuation="%s"' % self.gds_format_boolean(self.continuation, input_name='continuation'))
7484
        if self.custom is not None and 'custom' not in already_processed:
7485
            already_processed.add('custom')
7486
            outfile.write(' custom=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.custom), input_name='custom')), ))
7487
        if self.comments is not None and 'comments' not in already_processed:
7488
            already_processed.add('comments')
7489
            outfile.write(' comments=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.comments), input_name='comments')), ))
7490
    def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:pc="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15"', name_='UnorderedGroupType', fromsubclass_=False, pretty_print=True):
7491
        if pretty_print:
7492
            eol_ = '\n'
@@ 7016-7037 (lines=22) @@
7013
            outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
7014
        else:
7015
            outfile.write('/>%s' % (eol_, ))
7016
    def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='OrderedGroupType'):
7017
        if self.id is not None and 'id' not in already_processed:
7018
            already_processed.add('id')
7019
            outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
7020
        if self.regionRef is not None and 'regionRef' not in already_processed:
7021
            already_processed.add('regionRef')
7022
            outfile.write(' regionRef=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.regionRef), input_name='regionRef')), ))
7023
        if self.caption is not None and 'caption' not in already_processed:
7024
            already_processed.add('caption')
7025
            outfile.write(' caption=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.caption), input_name='caption')), ))
7026
        if self.type_ is not None and 'type_' not in already_processed:
7027
            already_processed.add('type_')
7028
            outfile.write(' type=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.type_), input_name='type')), ))
7029
        if self.continuation is not None and 'continuation' not in already_processed:
7030
            already_processed.add('continuation')
7031
            outfile.write(' continuation="%s"' % self.gds_format_boolean(self.continuation, input_name='continuation'))
7032
        if self.custom is not None and 'custom' not in already_processed:
7033
            already_processed.add('custom')
7034
            outfile.write(' custom=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.custom), input_name='custom')), ))
7035
        if self.comments is not None and 'comments' not in already_processed:
7036
            already_processed.add('comments')
7037
            outfile.write(' comments=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.comments), input_name='comments')), ))
7038
    def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:pc="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15"', name_='OrderedGroupType', fromsubclass_=False, pretty_print=True):
7039
        if pretty_print:
7040
            eol_ = '\n'