Skip to content

Commit

Permalink
Merge pull request #443 from plotly/fix-registered-path
Browse files Browse the repository at this point in the history
Change registered_paths to a `collections.defaultdict(set)`.
  • Loading branch information
T4rk1n authored Nov 5, 2018
2 parents 61b0545 + 229978b commit 09f551a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.28.6 - 2018-11-05
## Fixed
- `Dash.registered_paths` changed to a `collections.defaultdict(set)`, was appending the same package paths on every index. [#443](https://github.com/plotly/dash/pull/443)

## 0.28.5 - 2018-10-18
## Fixed
- Replace windows endline when generating the components classes docstring [#431](https://github.com/plotly/dash/pull/431)
Expand Down
7 changes: 2 additions & 5 deletions dash/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def _handle_error(error):

self.assets_ignore = assets_ignore

self.registered_paths = {}
self.registered_paths = collections.defaultdict(set)

# urls
self.routes = []
Expand Down Expand Up @@ -313,10 +313,7 @@ def _collect_and_register_resources(self, resources):
def _relative_url_path(relative_package_path='', namespace=''):

# track the registered packages
if namespace in self.registered_paths:
self.registered_paths[namespace].append(relative_package_path)
else:
self.registered_paths[namespace] = [relative_package_path]
self.registered_paths[namespace].add(relative_package_path)

module_path = os.path.join(
os.path.dirname(sys.modules[namespace].__file__),
Expand Down
2 changes: 1 addition & 1 deletion dash/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.28.5'
__version__ = '0.28.6'

0 comments on commit 09f551a

Please sign in to comment.