Author: rmarianski
Date: 2007-11-22 21:36:51 -0500 (Thu, 22 Nov 2007)
New Revision: 11234

Modified:
   topp.featurelets/trunk/topp/featurelets/base.py
   topp.featurelets/trunk/topp/featurelets/supporter.py
Log:
necessary changes for moving featurelet registrations into zcml

Modified: topp.featurelets/trunk/topp/featurelets/base.py
===================================================================
--- topp.featurelets/trunk/topp/featurelets/base.py     2007-11-23 02:34:50 UTC 
(rev 11233)
+++ topp.featurelets/trunk/topp/featurelets/base.py     2007-11-23 02:36:51 UTC 
(rev 11234)
@@ -26,6 +26,9 @@
 
     config_view = None
     installed_marker = None
+
+    def __init__(self, context):
+        self.context = context
     
     def _checkForRequiredInterfaces(self, obj):
         """
@@ -177,3 +180,8 @@
         if self.installed_marker is not None:
             directlyProvides(obj, directlyProvidedBy(obj) -
                              self.installed_marker)
+
+    @property
+    def installed(self):
+        #XXX double context due to IFeaturelet(IFeatureletSupporter(IProject)))
+        return self.installed_marker.providedBy(self.context.context)

Modified: topp.featurelets/trunk/topp/featurelets/supporter.py
===================================================================
--- topp.featurelets/trunk/topp/featurelets/supporter.py        2007-11-23 
02:34:50 UTC (rev 11233)
+++ topp.featurelets/trunk/topp/featurelets/supporter.py        2007-11-23 
02:36:51 UTC (rev 11234)
@@ -2,9 +2,10 @@
 
 from zope.interface import implements, providedBy
 from zope.app.annotation.interfaces import IAnnotations
+from zope.component import getAdapter
 from zope.component import getUtility
 
-from interfaces import IFeatureletSupporter, IFeaturelet, IFeatureletRegistry
+from interfaces import IFeatureletSupporter, IFeaturelet
 
 class FeatureletSupporter(object):
     """
@@ -55,5 +56,4 @@
         #if not isinstance(name, basestring) and IFeaturelet.providedBy(name):
         if not isinstance(name, basestring):
             return name.id, name
-        reg = getUtility(IFeatureletRegistry)
-        return name, reg.getFeaturelet(name)
+        return name, getAdapter(self, IFeaturelet, name)



--
Archive: 
http://www.openplans.org/projects/opencore/lists/openplans-svn/archive/2007/11/1195785411843
To unsubscribe send an email with subject unsubscribe to [EMAIL PROTECTED]  
Please contact [EMAIL PROTECTED] for questions.

Reply via email to