Code Duplication    Length = 25-25 lines in 2 locations

src/ocrd_models/ocrd_page_generateds.py 2 locations

@@ 7344-7368 (lines=25) @@
7341
            outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
7342
        else:
7343
            outfile.write('/>%s' % (eol_, ))
7344
    def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='UnorderedGroupIndexedType'):
7345
        if self.id is not None and 'id' not in already_processed:
7346
            already_processed.add('id')
7347
            outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
7348
        if self.regionRef is not None and 'regionRef' not in already_processed:
7349
            already_processed.add('regionRef')
7350
            outfile.write(' regionRef=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.regionRef), input_name='regionRef')), ))
7351
        if self.index is not None and 'index' not in already_processed:
7352
            already_processed.add('index')
7353
            outfile.write(' index="%s"' % self.gds_format_integer(self.index, input_name='index'))
7354
        if self.caption is not None and 'caption' not in already_processed:
7355
            already_processed.add('caption')
7356
            outfile.write(' caption=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.caption), input_name='caption')), ))
7357
        if self.type_ is not None and 'type_' not in already_processed:
7358
            already_processed.add('type_')
7359
            outfile.write(' type=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.type_), input_name='type')), ))
7360
        if self.continuation is not None and 'continuation' not in already_processed:
7361
            already_processed.add('continuation')
7362
            outfile.write(' continuation="%s"' % self.gds_format_boolean(self.continuation, input_name='continuation'))
7363
        if self.custom is not None and 'custom' not in already_processed:
7364
            already_processed.add('custom')
7365
            outfile.write(' custom=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.custom), input_name='custom')), ))
7366
        if self.comments is not None and 'comments' not in already_processed:
7367
            already_processed.add('comments')
7368
            outfile.write(' comments=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.comments), input_name='comments')), ))
7369
    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):
7370
        if pretty_print:
7371
            eol_ = '\n'
@@ 6856-6880 (lines=25) @@
6853
            outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
6854
        else:
6855
            outfile.write('/>%s' % (eol_, ))
6856
    def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='OrderedGroupIndexedType'):
6857
        if self.id is not None and 'id' not in already_processed:
6858
            already_processed.add('id')
6859
            outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
6860
        if self.regionRef is not None and 'regionRef' not in already_processed:
6861
            already_processed.add('regionRef')
6862
            outfile.write(' regionRef=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.regionRef), input_name='regionRef')), ))
6863
        if self.index is not None and 'index' not in already_processed:
6864
            already_processed.add('index')
6865
            outfile.write(' index="%s"' % self.gds_format_integer(self.index, input_name='index'))
6866
        if self.caption is not None and 'caption' not in already_processed:
6867
            already_processed.add('caption')
6868
            outfile.write(' caption=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.caption), input_name='caption')), ))
6869
        if self.type_ is not None and 'type_' not in already_processed:
6870
            already_processed.add('type_')
6871
            outfile.write(' type=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.type_), input_name='type')), ))
6872
        if self.continuation is not None and 'continuation' not in already_processed:
6873
            already_processed.add('continuation')
6874
            outfile.write(' continuation="%s"' % self.gds_format_boolean(self.continuation, input_name='continuation'))
6875
        if self.custom is not None and 'custom' not in already_processed:
6876
            already_processed.add('custom')
6877
            outfile.write(' custom=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.custom), input_name='custom')), ))
6878
        if self.comments is not None and 'comments' not in already_processed:
6879
            already_processed.add('comments')
6880
            outfile.write(' comments=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.comments), input_name='comments')), ))
6881
    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):
6882
        if pretty_print:
6883
            eol_ = '\n'