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

fixed pages to exclude files starting with . #2102

Merged
merged 3 commits into from
Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
## [UNRELEASED]

### Fixed

- [#2102](https://github.com/plotly/dash/pull/2102) Fix bug as reported in [dash-labs #113](https://github.com/plotly/dash-labs/issues/113) where files starting with `.` were not excluded when building `dash.page_registry`.
- [#2098](https://github.com/plotly/dash/pull/2098) Accept HTTP code 400 as well as 401 for JWT expiry
- [#2097](https://github.com/plotly/dash/pull/2097) Fix bug [#2095](https://github.com/plotly/dash/issues/2095) with TypeScript compiler and `React.FC` empty valueDeclaration error & support empty props components.

Expand Down
4 changes: 1 addition & 3 deletions dash/_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,7 @@ def register_page(
APNG, AVIF, GIF, JPEG, JPG, PNG, SVG, WebP.

- `image_url`:
This will use the exact image url provided when sharing on social media.
This is appealing when the image you want to share is hosted on a CDN.
Using this attribute overrides the image attribute.
Overrides the image property and sets the `<image>` meta tag to the provided image URL.

- `redirect_from`:
A list of paths that should redirect to this page.
Expand Down
6 changes: 5 additions & 1 deletion dash/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -2167,7 +2167,11 @@ def _import_layouts_from_pages(self):

for (root, _, files) in os.walk(walk_dir):
for file in files:
if file.startswith("_") or not file.endswith(".py"):
if (
file.startswith("_")
or file.startswith(".")
or not file.endswith(".py")
):
continue
with open(os.path.join(root, file), encoding="utf-8") as f:
content = f.read()
Expand Down
1 change: 1 addition & 0 deletions tests/integration/multi_page/pages/.no_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
raise Exception("files starting with . should not be imported")
1 change: 1 addition & 0 deletions tests/integration/multi_page/pages/_no_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
raise Exception("files starting with _ should not be imported")
Empty file.
6 changes: 0 additions & 6 deletions usage-pages/pages_error/page1.py

This file was deleted.