core
core copied to clipboard
fix: Resource Manager: Unlink archives after extracting #1245
~A fix for https://github.com/OCR-D/core/issues/1245 and some minor refactoring related to strings.~
- Some minor refactoring over the resource manager.
- A fix for #1201
- If overwrite is not set, the existing entries will be skipped with a warning instead of raising an exception
To not make this PR just some refactoring, I would tackle #1201 here as well. Once that is resolved I have an additional idea. Skipping existing resources should also be an option.
Currently
ocrd resmgr download '*'
fails if there are some existing models. The -o flag is a must in that case. However, that is not optimal. Ideally, skipping existing resources should also be possible. The -o and -s flags will be mutually exclusive.
-s, --skip Skip existing resources
Then
ocrd resmgr download -s '*'
Will download the missing resources only. That is also useful when a connection error occurs and the model downloading should be restarted.
@bertsky, does that make sense?
I would tackle #1201 here as well.
great!
Currently
ocrd resmgr download '*'fails if there are some existing models. The
-oflag is a must in that case. However, that is not optimal. Ideally, skipping existing resources should also be possible. The-oand-sflags will be mutually exclusive.
Ouch! I did not notice this before. Very good point!
But then I would rather recommend making -s the implicit/default, and -o the non-default behaviour.
But then I would rather recommend making -s the implicit/default
d5173ad.