Code Duplication    Length = 10-10 lines in 2 locations

src/ocrd/processor/base.py 2 locations

@@ 1081-1090 (lines=10) @@
1078
                        # filter was inactive but no PAGE is in control, this must not happen
1079
                        self._base_logger.warning(f"added file {file_.ID} for page {file_.pageId} in input file group {ifg} "
1080
                                                  f"conflicts with file {ift[i].ID} but no PAGE available - on_error={on_error}")
1081
                        if on_error == 'skip':
1082
                            ift[i] = None
1083
                        elif on_error == 'first':
1084
                            pass # keep first match
1085
                        elif on_error == 'last':
1086
                            ift[i] = file_
1087
                        elif on_error == 'abort':
1088
                            raise NonUniqueInputFile(ifg, file_.pageId, None)
1089
                        else:
1090
                            raise Exception("Unknown 'on_error' strategy '%s'" % on_error)
1091
                else:
1092
                    self._base_logger.debug(f"adding file {file_.ID} for page {file_.pageId} to input file group {ifg}")
1093
                    ift[i] = file_
@@ 1061-1070 (lines=10) @@
1058
                        # filter was active, this must not happen
1059
                        self._base_logger.warning(f"added file {file_.ID} for page {file_.pageId} in input file group {ifg} "
1060
                                                  f"conflicts with file {ift[i].ID} of same MIME type {mimetype} - on_error={on_error}")
1061
                        if on_error == 'skip':
1062
                            ift[i] = None
1063
                        elif on_error == 'first':
1064
                            pass # keep first match
1065
                        elif on_error == 'last':
1066
                            ift[i] = file_
1067
                        elif on_error == 'abort':
1068
                            raise NonUniqueInputFile(ifg, file_.pageId, mimetype)
1069
                        else:
1070
                            raise Exception("Unknown 'on_error' strategy '%s'" % on_error)
1071
                    elif (ift[i].mimetype == MIMETYPE_PAGE and
1072
                          file_.mimetype != MIMETYPE_PAGE):
1073
                        pass # keep PAGE match