Code Duplication    Length = 13-13 lines in 2 locations

src/ocrd_models/ocrd_page_generateds.py 2 locations

@@ 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'
@@ 9304-9316 (lines=13) @@
9301
            outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
9302
        else:
9303
            outfile.write('/>%s' % (eol_, ))
9304
    def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='RelationType'):
9305
        if self.id is not None and 'id' not in already_processed:
9306
            already_processed.add('id')
9307
            outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
9308
        if self.type_ is not None and 'type_' not in already_processed:
9309
            already_processed.add('type_')
9310
            outfile.write(' type=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.type_), input_name='type')), ))
9311
        if self.custom is not None and 'custom' not in already_processed:
9312
            already_processed.add('custom')
9313
            outfile.write(' custom=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.custom), input_name='custom')), ))
9314
        if self.comments is not None and 'comments' not in already_processed:
9315
            already_processed.add('comments')
9316
            outfile.write(' comments=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.comments), input_name='comments')), ))
9317
    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):
9318
        if pretty_print:
9319
            eol_ = '\n'