Changed base class for site root "++etc++" traverser
authorThierry Florac <tflorac@ulthar.net>
Sun, 22 Feb 2015 14:52:03 +0100
changeset 3 2919bac002e3
parent 2 a4db31e40fe1
child 4 be32c837e341
Changed base class for site root "++etc++" traverser
src/pyams_utils/site.py
--- a/src/pyams_utils/site.py	Sat Feb 21 13:51:51 2015 +0100
+++ b/src/pyams_utils/site.py	Sun Feb 22 14:52:03 2015 +0100
@@ -26,7 +26,7 @@
 
 # import packages
 from persistent.dict import PersistentDict
-from pyams_utils.adapter import adapter_config
+from pyams_utils.adapter import adapter_config, ContextAdapter
 from pyams_utils.registry import get_utilities_for, query_utility
 from pyramid.events import subscriber
 from pyramid.exceptions import NotFound
@@ -51,12 +51,9 @@
 
 
 @adapter_config(name='etc', context=ISiteRoot, provides=ITraversable)
-class SiteRootEtcTraverser(object):
+class SiteRootEtcTraverser(ContextAdapter):
     """Site root ++etc++ namespace traverser"""
 
-    def __init__(self, context):
-        self.context = context
-
     def traverse(self, name, furtherpath=None):
         if name == 'site':
             return self.context.getSiteManager()