OCR-D / core

Collection of OCR-related python tools and wrappers from @OCR-D
https://ocr-d.de/core/
Apache License 2.0
118 stars 31 forks source link

fix: Resource Manager: Unlink archives after extracting #1245 #1246

Closed MehmedGIT closed 2 months ago

MehmedGIT commented 3 months ago

~A fix for https://github.com/OCR-D/core/issues/1245 and some minor refactoring related to strings.~

MehmedGIT commented 3 months ago

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?

bertsky commented 3 months ago

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.

MehmedGIT commented 3 months ago

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

d5173ad.