Esempio n. 1
0
class SiteViewComponents(BaseGlobalComponents):
    def _init_registries(self):
        # This is why this class is needed: we can't work with a
        # regular AdapterRegistry because it wants to do funny things
        # with __bases__.
        self.adapters = VerifyingAdapterRegistry()
        self.utilities = VerifyingAdapterRegistry()
        if HAS_FIVE_LSM:
            self.utilities.LookupClass = registry.FiveVerifyingAdapterLookup
            self.utilities._createLookup()
            self.utilities.__parent__ = self

    if HAS_FIVE_LSM:

        def registeredUtilities(self):
            for ((provided, name), (component, info)) in self._utility_registrations.iteritems():
                yield UtilityRegistration(self, provided, name, registry._wrap(component, self), info)
Esempio n. 2
0
 def _init_registries(self):
     # This is why this class is needed: we can't work with a
     # regular AdapterRegistry because it wants to do funny things
     # with __bases__.
     self.adapters = VerifyingAdapterRegistry()
     self.utilities = VerifyingAdapterRegistry()
     if HAS_FIVE_LSM:
         self.utilities.LookupClass = registry.FiveVerifyingAdapterLookup
         self.utilities._createLookup()
         self.utilities.__parent__ = self
 def _removeValueFromLeaf(self, existing_leaf_sequence, to_remove):
     without_removed = VerifyingAdapterRegistry._removeValueFromLeaf(
         self, existing_leaf_sequence, to_remove)
     existing_leaf_sequence[:] = without_removed
     return existing_leaf_sequence