--- a/src/pyams_viewlet/manager.py Thu Feb 19 10:27:51 2015 +0100
+++ b/src/pyams_viewlet/manager.py Fri Mar 20 17:17:20 2015 +0100
@@ -103,12 +103,7 @@
if self.permission and not self.request.has_permission(self.permission):
return
# Find all content providers for the region
- registry = self.request.registry
- viewlets = registry.getAdapters((self.context, self.request, self.__parent__, self),
- IViewlet)
-
- viewlets = self.filter(viewlets)
- viewlets = self.sort(viewlets)
+ viewlets = self._get_viewlets()
# Just use the viewlets from now on
self.viewlets = []
for name, viewlet in viewlets:
@@ -117,6 +112,15 @@
self.viewlets.append(viewlet)
self._update_viewlets()
+ def _get_viewlets(self):
+ """Find all content providers for the region"""
+ registry = self.request.registry
+ viewlets = registry.getAdapters((self.context, self.request, self.__parent__, self),
+ IViewlet)
+ viewlets = self.filter(viewlets)
+ viewlets = self.sort(viewlets)
+ return viewlets
+
def _update_viewlets(self):
"""Calls update on all viewlets and fires events"""
registry = self.request.registry