Title: Allow resources to be in subdirectories · Issue #58 · python/importlib_resources · GitHub
Open Graph Title: Allow resources to be in subdirectories · Issue #58 · python/importlib_resources
X Title: Allow resources to be in subdirectories · Issue #58 · python/importlib_resources
Description: In GitLab by @rob.speer on May 16, 2018, 01:23 Suppose I have a Web application, myapp, that needs to serve a static file, which by convention needs to be in the path myapp/static/ld/context.ld.json. Suppose I also want to be able to acc...
Open Graph Description: In GitLab by @rob.speer on May 16, 2018, 01:23 Suppose I have a Web application, myapp, that needs to serve a static file, which by convention needs to be in the path myapp/static/ld/context.ld.jso...
X Description: In GitLab by @rob.speer on May 16, 2018, 01:23 Suppose I have a Web application, myapp, that needs to serve a static file, which by convention needs to be in the path myapp/static/ld/context.ld.jso...
Opengraph URL: https://github.com/python/importlib_resources/issues/58
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow resources to be in subdirectories","articleBody":"In GitLab by @rob.speer on May 16, 2018, 01:23\n\nSuppose I have a Web application, `myapp`, that needs to serve a static file, which by convention needs to be in the path `myapp/static/ld/context.ld.json`. Suppose I also want to be able to access that file from Python code, because its contents are used in a test.\n\nAs importlib_resources is currently defined, I would need to rewrite the path as if it were a Python submodule, even though it does not contain actual Python code: `path(myapp.static.ld, \"context.ld.json\")`. I would also need to create empty files named `myapp/static/__init__.py` and `myapp/static/ld/__init__.py`, and hopefully exclude them from being served as static files.\n\nThat would be enough for me to give up and use paths relative to `__file__` instead. In general, I would heartily recommend importlib if I could reasonably promise that it was an improvement over using `__file__` or over existing uses of `pkg_resources`, which it wouldn't be if it doesn't support subdirectories.\n\nThe call I would like to be able to make in this situation is `path(myapp, \"static/ld/context.ld.json\")`.","author":{"url":"https://github.com/jaraco","@type":"Person","name":"jaraco"},"datePublished":"2020-10-21T21:59:09Z","url":"https://github.com/python/importlib_resources/issues/58"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3167321b-8b27-1276-2d36-4273369fd664 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D09C:2DCAE8:2B9303E:3BA3319:6B005AD8 |
| html-safe-nonce | e94f2eaab85158fcca5695b8e0d16fbeca644b40e3264931afbdca8d5d9c2f6f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDlDOjJEQ0FFODoyQjkzMDNFOjNCQTMzMTk6NkIwMDVBRDgiLCJ2aXNpdG9yX2lkIjoiMTM3NDU1NzExNzU0OTE0MDY5NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 330bd5aab02b91f1877e3118acf83b2812765a2234d66ef46f20ef59398f4a4e |
| hovercard-subject-tag | issue:726891711 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/importlib_resources/58/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5eca9dda6d692e371341530db5f2d880e996d758f3eb396b3cbbc39b78457009/python/importlib_resources/issues/58 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5eca9dda6d692e371341530db5f2d880e996d758f3eb396b3cbbc39b78457009/python/importlib_resources/issues/58 |
| og:image:alt | In GitLab by @rob.speer on May 16, 2018, 01:23 Suppose I have a Web application, myapp, that needs to serve a static file, which by convention needs to be in the path myapp/static/ld/context.ld.jso... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jaraco |
| hostname | github.com |
| expected-hostname | github.com |
| None | 29be975efff6507a5d135de9c7d634cf7ff8f0c55222a64386ab3202209aaf73 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/importlib_resources git https://github.com/python/importlib_resources.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 306147182 |
| octolytics-dimension-repository_nwo | python/importlib_resources |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 306147182 |
| octolytics-dimension-repository_network_root_nwo | python/importlib_resources |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | eacd927ba6112e3b01ba99c762bd699a4a4f5df7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width