Skip to content

Commit

Permalink
Merge pull request #2102 from AnnMarieW/fix-pages-exclude-files
Browse files Browse the repository at this point in the history
fixed pages to exclude files starting with `.`
  • Loading branch information
alexcjohnson authored Jun 28, 2022
2 parents d558862 + d21da84 commit 7558567
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 11 deletions.
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.
- [#2104](https://github.com/plotly/dash/pull/2104) Fix bug [#2099](https://github.com/plotly/dash/issues/2099) with Dropdown clearing search value when a value is selected.
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.

0 comments on commit 7558567

Please sign in to comment.