diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-11-25 22:26:10 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-11-25 22:26:10 +0000 |
| commit | 914019a1f687c079c076af56174c8601eba0015b (patch) | |
| tree | 8047374b42ece74600d07401dfdffd5811b868dc | |
| parent | d6b4cdd6254119ab90a18a8b1c2f00daebc7e7ab (diff) | |
| download | pyramid-914019a1f687c079c076af56174c8601eba0015b.tar.gz pyramid-914019a1f687c079c076af56174c8601eba0015b.tar.bz2 pyramid-914019a1f687c079c076af56174c8601eba0015b.zip | |
Don't depend on adaptedBy.
| -rw-r--r-- | repoze/bfg/zcml.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/repoze/bfg/zcml.py b/repoze/bfg/zcml.py index 91252ff53..f3d722461 100644 --- a/repoze/bfg/zcml.py +++ b/repoze/bfg/zcml.py @@ -1,5 +1,3 @@ -from zope.component import adaptedBy - from zope.configuration.exceptions import ConfigurationError from zope.configuration.fields import GlobalInterface from zope.configuration.fields import GlobalObject @@ -539,7 +537,7 @@ def adapter(_context, factory, provides=None, for_=None, name=''): if for_ is None: if len(factory) == 1: - for_ = adaptedBy(factory[0]) + for_ = getattr(factory[0], '__component_adapts__', None) if for_ is None: raise TypeError("No for attribute was provided and can't " @@ -628,7 +626,7 @@ def subscriber(_context, for_=None, factory=None, handler=None, provides=None): "a factory") if for_ is None: - for_ = adaptedBy(factory) + for_ = getattr(factory, '__component_adapts__', None) if for_ is None: raise TypeError("No for attribute was provided and can't " "determine what the factory (or handler) adapts.") @@ -700,7 +698,7 @@ def utility(_context, provides=None, component=None, factory=None, name=''): if factory: kw = dict(factory=factory) else: - # older zope.component registries don't accept factory as a kwarg, + # older component registries don't accept factory as a kwarg, # so if we don't need it, we don't pass it kw = {} |
