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

refactot Route.all_plugins() #1306

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
14 changes: 7 additions & 7 deletions bottle.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,14 +550,14 @@ def prepare(self):

def all_plugins(self):
""" Yield all Plugins affecting this route. """
unique = set()
if True in self.skiplist: return
skips = set(self.skiplist)
for p in reversed(self.app.plugins + self.plugins):
if True in self.skiplist: break
name = getattr(p, 'name', False)
if name and (name in self.skiplist or name in unique): continue
if p in self.skiplist or type(p) in self.skiplist: continue
if name: unique.add(name)
yield p
if p not in skips and type(p) not in skips:
name = getattr(p, 'name', False)
if not name or name and name not in skips:
skips.add(name)
yield p

def _make_callback(self):
callback = self.callback
Expand Down