Code Duplication    Length = 22-22 lines in 2 locations

src/ocrd_models/ocrd_page_generateds.py 2 locations

@@ 8296-8317 (lines=22) @@
8293
            outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
8294
        else:
8295
            outfile.write('/>%s' % (eol_, ))
8296
    def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='UnorderedGroupType'):
8297
        if self.id is not None and 'id' not in already_processed:
8298
            already_processed.add('id')
8299
            outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
8300
        if self.regionRef is not None and 'regionRef' not in already_processed:
8301
            already_processed.add('regionRef')
8302
            outfile.write(' regionRef=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.regionRef), input_name='regionRef')), ))
8303
        if self.caption is not None and 'caption' not in already_processed:
8304
            already_processed.add('caption')
8305
            outfile.write(' caption=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.caption), input_name='caption')), ))
8306
        if self.type_ is not None and 'type_' not in already_processed:
8307
            already_processed.add('type_')
8308
            outfile.write(' type=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.type_), input_name='type')), ))
8309
        if self.continuation is not None and 'continuation' not in already_processed:
8310
            already_processed.add('continuation')
8311
            outfile.write(' continuation="%s"' % self.gds_format_boolean(self.continuation, input_name='continuation'))
8312
        if self.custom is not None and 'custom' not in already_processed:
8313
            already_processed.add('custom')
8314
            outfile.write(' custom=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.custom), input_name='custom')), ))
8315
        if self.comments is not None and 'comments' not in already_processed:
8316
            already_processed.add('comments')
8317
            outfile.write(' comments=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.comments), input_name='comments')), ))
8318
    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):
8319
        if pretty_print:
8320
            eol_ = '\n'
@@ 7828-7849 (lines=22) @@
7825
            outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
7826
        else:
7827
            outfile.write('/>%s' % (eol_, ))
7828
    def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='OrderedGroupType'):
7829
        if self.id is not None and 'id' not in already_processed:
7830
            already_processed.add('id')
7831
            outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
7832
        if self.regionRef is not None and 'regionRef' not in already_processed:
7833
            already_processed.add('regionRef')
7834
            outfile.write(' regionRef=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.regionRef), input_name='regionRef')), ))
7835
        if self.caption is not None and 'caption' not in already_processed:
7836
            already_processed.add('caption')
7837
            outfile.write(' caption=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.caption), input_name='caption')), ))
7838
        if self.type_ is not None and 'type_' not in already_processed:
7839
            already_processed.add('type_')
7840
            outfile.write(' type=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.type_), input_name='type')), ))
7841
        if self.continuation is not None and 'continuation' not in already_processed:
7842
            already_processed.add('continuation')
7843
            outfile.write(' continuation="%s"' % self.gds_format_boolean(self.continuation, input_name='continuation'))
7844
        if self.custom is not None and 'custom' not in already_processed:
7845
            already_processed.add('custom')
7846
            outfile.write(' custom=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.custom), input_name='custom')), ))
7847
        if self.comments is not None and 'comments' not in already_processed:
7848
            already_processed.add('comments')
7849
            outfile.write(' comments=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.comments), input_name='comments')), ))
7850
    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):
7851
        if pretty_print:
7852
            eol_ = '\n'