Code Duplication    Length = 25-25 lines in 2 locations

src/ocrd_models/ocrd_page_generateds.py 2 locations

@@ 6545-6569 (lines=25) @@
6542
            outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
6543
        else:
6544
            outfile.write('/>%s' % (eol_, ))
6545
    def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='UnorderedGroupIndexedType'):
6546
        if self.id is not None and 'id' not in already_processed:
6547
            already_processed.add('id')
6548
            outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
6549
        if self.regionRef is not None and 'regionRef' not in already_processed:
6550
            already_processed.add('regionRef')
6551
            outfile.write(' regionRef=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.regionRef), input_name='regionRef')), ))
6552
        if self.index is not None and 'index' not in already_processed:
6553
            already_processed.add('index')
6554
            outfile.write(' index="%s"' % self.gds_format_integer(self.index, input_name='index'))
6555
        if self.caption is not None and 'caption' not in already_processed:
6556
            already_processed.add('caption')
6557
            outfile.write(' caption=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.caption), input_name='caption')), ))
6558
        if self.type_ is not None and 'type_' not in already_processed:
6559
            already_processed.add('type_')
6560
            outfile.write(' type=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.type_), input_name='type')), ))
6561
        if self.continuation is not None and 'continuation' not in already_processed:
6562
            already_processed.add('continuation')
6563
            outfile.write(' continuation="%s"' % self.gds_format_boolean(self.continuation, input_name='continuation'))
6564
        if self.custom is not None and 'custom' not in already_processed:
6565
            already_processed.add('custom')
6566
            outfile.write(' custom=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.custom), input_name='custom')), ))
6567
        if self.comments is not None and 'comments' not in already_processed:
6568
            already_processed.add('comments')
6569
            outfile.write(' comments=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.comments), input_name='comments')), ))
6570
    def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:pc="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15"', name_='UnorderedGroupIndexedType', fromsubclass_=False, pretty_print=True):
6571
        if pretty_print:
6572
            eol_ = '\n'
@@ 6075-6099 (lines=25) @@
6072
            outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
6073
        else:
6074
            outfile.write('/>%s' % (eol_, ))
6075
    def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='OrderedGroupIndexedType'):
6076
        if self.id is not None and 'id' not in already_processed:
6077
            already_processed.add('id')
6078
            outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
6079
        if self.regionRef is not None and 'regionRef' not in already_processed:
6080
            already_processed.add('regionRef')
6081
            outfile.write(' regionRef=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.regionRef), input_name='regionRef')), ))
6082
        if self.index is not None and 'index' not in already_processed:
6083
            already_processed.add('index')
6084
            outfile.write(' index="%s"' % self.gds_format_integer(self.index, input_name='index'))
6085
        if self.caption is not None and 'caption' not in already_processed:
6086
            already_processed.add('caption')
6087
            outfile.write(' caption=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.caption), input_name='caption')), ))
6088
        if self.type_ is not None and 'type_' not in already_processed:
6089
            already_processed.add('type_')
6090
            outfile.write(' type=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.type_), input_name='type')), ))
6091
        if self.continuation is not None and 'continuation' not in already_processed:
6092
            already_processed.add('continuation')
6093
            outfile.write(' continuation="%s"' % self.gds_format_boolean(self.continuation, input_name='continuation'))
6094
        if self.custom is not None and 'custom' not in already_processed:
6095
            already_processed.add('custom')
6096
            outfile.write(' custom=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.custom), input_name='custom')), ))
6097
        if self.comments is not None and 'comments' not in already_processed:
6098
            already_processed.add('comments')
6099
            outfile.write(' comments=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.comments), input_name='comments')), ))
6100
    def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:pc="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15"', name_='OrderedGroupIndexedType', fromsubclass_=False, pretty_print=True):
6101
        if pretty_print:
6102
            eol_ = '\n'