question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

list_all_resources does not handle subdirectories well

See original GitHub issue

In ocrd_utils.list_all_resources (used by a processor’s --list-resources and resmgr’s --list-installed), entries that are themselves directories do not get traversed recursively.

That’s okay if the processor takes directory resources (e.g. ocrd-calamari-recognize’s h5/json checkpoint dirs), but not if its resources are files in subdirectories (e.g. ocrd-tesserocr-recognize’s script/*.traineddata or configs/*).

So IMO a better behaviour would be to list all such directories recursively.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:22 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
krvoigtcommented, Dec 7, 2021
0reactions
bertskycommented, Feb 2, 2022

Are you sure you have reinstalled or installed with pip install -e

Yes, I am sure. Clone of core is at 836eb05e791a196ea7f7e00b6f7438d74ebca582, I used make install, and venv reports:

ocrd, version 2.30.0

I can still see the directory entries.

(and we really need to sort this output)

speaking of which: in #792 I have added sorting via https://github.com/OCR-D/core/pull/792/commits/d108dd06392caed06286b2c3ebb7ac491581e6a7, but that only gives sorted output of ocrd resmgr, not of TOOL -L. So I should probably move the line to ocrd_utils.list_all_resources

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get a list of resources from classpath directory - java
The first method described in this answer -- reading the path as a resource, does not seem to work when the resources are...
Read more >
Listing all assets within a folder - Cloudinary Support
You can use the Admin API to list all resources contained within a specific folder (including sub-folders). Here's an example of how to...
Read more >
Can you use DIR to list files in subfolders ? - MATLAB Answers
Would somebody be able to advise me on how to use DIR to find the dates that each file was last modified ......
Read more >
Version Control with Git: Creating a Repository - NIST Pages
It is important to note that git init will create a repository that includes subdirectories and their files—there is no need to create...
Read more >
Get list of subdirectories which contain a file whose name ...
More specifically, I am looking for directories which contain a file with the letter 'f' somewhere occurring in the file name. Ideally, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found