Code Duplication    Length = 13-13 lines in 2 locations

src/ocrd_models/ocrd_page_generateds.py 2 locations

@@ 9300-9312 (lines=13) @@
9297
            outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
9298
        else:
9299
            outfile.write('/>%s' % (eol_, ))
9300
    def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='RelationType'):
9301
        if self.id is not None and 'id' not in already_processed:
9302
            already_processed.add('id')
9303
            outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
9304
        if self.type_ is not None and 'type_' not in already_processed:
9305
            already_processed.add('type_')
9306
            outfile.write(' type=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.type_), input_name='type')), ))
9307
        if self.custom is not None and 'custom' not in already_processed:
9308
            already_processed.add('custom')
9309
            outfile.write(' custom=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.custom), input_name='custom')), ))
9310
        if self.comments is not None and 'comments' not in already_processed:
9311
            already_processed.add('comments')
9312
            outfile.write(' comments=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.comments), input_name='comments')), ))
9313
    def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:pc="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15"', name_='RelationType', fromsubclass_=False, pretty_print=True):
9314
        if pretty_print:
9315
            eol_ = '\n'
@@ 2371-2383 (lines=13) @@
2368
            outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
2369
        else:
2370
            outfile.write('/>%s' % (eol_, ))
2371
    def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='LabelsType'):
2372
        if self.externalModel is not None and 'externalModel' not in already_processed:
2373
            already_processed.add('externalModel')
2374
            outfile.write(' externalModel=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.externalModel), input_name='externalModel')), ))
2375
        if self.externalId is not None and 'externalId' not in already_processed:
2376
            already_processed.add('externalId')
2377
            outfile.write(' externalId=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.externalId), input_name='externalId')), ))
2378
        if self.prefix is not None and 'prefix' not in already_processed:
2379
            already_processed.add('prefix')
2380
            outfile.write(' prefix=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.prefix), input_name='prefix')), ))
2381
        if self.comments is not None and 'comments' not in already_processed:
2382
            already_processed.add('comments')
2383
            outfile.write(' comments=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.comments), input_name='comments')), ))
2384
    def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:pc="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15"', name_='LabelsType', fromsubclass_=False, pretty_print=True):
2385
        if pretty_print:
2386
            eol_ = '\n'