core icon indicating copy to clipboard operation
core copied to clipboard

fix: Resource Manager: Unlink archives after extracting #1245

Open MehmedGIT opened this issue 1 year ago • 3 comments

~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

MehmedGIT avatar Jul 03 '24 15:07 MehmedGIT

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?

MehmedGIT avatar Jul 04 '24 14:07 MehmedGIT

I would tackle #1201 here as well.

great!

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.

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.

bertsky avatar Jul 04 '24 14:07 bertsky

But then I would rather recommend making -s the implicit/default

d5173ad.

MehmedGIT avatar Jul 05 '24 09:07 MehmedGIT