Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanctorale data files: loading mechanism not relying on relative paths (only) #77

Open
igneus opened this issue Jan 1, 2021 · 0 comments

Comments

@igneus
Copy link
Owner

igneus commented Jan 1, 2021

Since 0.7.0 there is method SanctoraleFactory.load_with_parents, recursively loading and correctly merging parent calendars specified in each file's YAML front matter. The only supported way to refer to a parent data file is by it's path relative to the current file. But there are scenarios when the library's user will want to be able to refer to well-known data files without knowing their relative filesystem path - e.g. to the data files bundled in calendarium-romanum. (There is already an example in the wild: some of the data files in https://github.com/calendarium-romanum/data-contrib need such references.) For cases like this, there should be an alternative parent loading method, looking for parent calendars in some sort of a repository object rather than interacting directly with the filesystem.

The repository mechanism should be flexible and (based on how the repository object is constructed) allow any combination of

  • filesystem lookup by (unlimited) relative paths, just like SanctoraleFactory.load_with_parents does
  • filesystem lookup limited to whitelisted directories (references to files outside of the whitelisted directories will result in an error)
  • id => in-memory data mapping in a Hash-like object
  • id => filesystem path mapping in a Hash like object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant