Closed bertsky closed 2 months ago
2. we could not rely on any constructor method other than full processing mode, because that's the only one which does parameter init
Actually, I don't remember why we should need a parameter initialisation.
We could do with some phony init (like show_version). If only resolve_resource
was a class method...
How about cherry-picking https://github.com/OCR-D/core/pull/1240/commits/9827c4d18d42f36a94c65621442be29a98e7254e and making resolve_resource
a class method?
and making
resolve_resource
a class method?
nah, that would not work – we do have state in that function: if the constructor did a chdir to the workspace, then in order to resolve CWD location resources, we have to chdir back.
Example: https://app.circleci.com/pipelines/github/bertsky/ocrd_cis/6/workflows/8ce0fe22-dfdf-446d-bf16-96d26523b31c/jobs/11
Explanation:
workspace
,output_file_grp
,parameter
etc)hasattr
check to determine whether theirsetup
should be called will now fire twice https://github.com/bertsky/ocrd_cis/blob/eb4efe1e7bd21e9a1cf5d7c18dcca4d868a92f66/ocrd_cis/ocropy/recognize.py#L91-L93There's next to no way of checking the true status from the inheriting processors, also I would really like to avoid touching them. So this should be rectified in core IMO.
Ideas?