-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
enhancementNew feature or requestNew feature or request
Description
In order to implement ResourcePath.from_file_path() and Resource_path.file_path(), we internally keep a list of ResourceRoot objects. Exposing these roots could allow users to answer various tricky questions about resources:
- Is a given resource from a zipped or unzipped package?
- Does a given resource have overrides?
- When was a given resource last modified?
This functionality could be useful for packages like OverrideAudit. In addition, it could be used to implement resource caching (#24): a resource must be reloaded if either the modification time or the resource root has changed.
As a first thought, a resource root could support the following operations:
- resource_to_file_path(path) -> Path (already implemented)
- file_to_resource_path(path) -> ResourcePath (already implemented)
- resource_exists(path) → boolean
- resource_modified(path) → timestamp
- load_resource(path) → string
- load_binary_resource(path) → bytes
The following operation would be provided at the ResourcePath level (or perhaps in a new class?):
- roots_providing_resource(path) → List[ResourceRoot]
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request