Package gnue :: Package navigator :: Package external :: Package zope :: Package interface :: Module declarations :: Class ClassProvides
[show private | hide private]

Type ClassProvides

                 object --+    
                          |    
        ClassProvidesBasePy --+
                              |
         object --+           |
                  |           |
SpecificationBasePy --+       |
                      |       |
          Specification --+   |
                          |   |
                Declaration --+
                              |
                             ClassProvides


Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

For example:

>>> from gnue.navigator.external.zope.interface import Interface
>>> class IFooFactory(Interface):
...     pass
>>> class IFoo(Interface):
...     pass
>>> class C(object):
...     implements(IFoo)
...     classProvides(IFooFactory)
>>> [i.getName() for i in C.__provides__]
['IFooFactory']
>>> [i.getName() for i in C().__provides__]
['IFoo']

Method Summary
  __init__(self, cls, metacls, *interfaces)
  __get__(self, inst, cls)
  __reduce__(self)
    Inherited from Declaration
  __add__(self, other)
Add two specifications or a specification and an interface
  __contains__(self, interface)
Test whether an interface is in the specification
  __iter__(self)
Return an iterator for the interfaces in the specification
  __nonzero__(self)
Test whether there are any interfaces in a specification.
  __radd__(self, other)
Add two specifications or a specification and an interface
  __sub__(self, other)
Remove interfaces from a specification
  changed(self)
We, or something we depend on, have changed
  flattened(self)
Return an iterator of all included and extended interfaces
    Inherited from Specification
  extends(self, interface, strict)
Does the specification extend the given interface?
  get(self, name, default)
Query for an attribute description
  interfaces(self)
Return an iterator for the interfaces in the specification
  isImplementedBy(self, ob)
  isImplementedByInstancesOf(self, cls)
  isOrExtends(self, interface)
Is the interface the same as or extend the given interface
  providedBy(self, ob)
Is the interface implemented by an object
  subscribe(self, dependent)
  unsubscribe(self, dependent)
  weakref(self, callback)
    Inherited from SpecificationBasePy
  implementedBy(self, cls)
Test whether the specification is implemented by a class or factory.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
Return hash(x)...
  __new__(T, S, ...)
Return a new object with type S, a subtype of T...
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
Return repr(x)...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
Return str(x)...

Property Summary
    Inherited from Specification
  __bases__

Class Variable Summary
    Inherited from Specification
Implements __implemented__ = <implementedBy gnue.navigator.external...
ClassProvides __provides__ = <gnue.navigator.external.zope.interface.d...
    Inherited from SpecificationBasePy
ClassProvides __providedBy__ = <gnue.navigator.external.zope.interface...

Method Details

__init__(self, cls, metacls, *interfaces)
(Constructor)

Overrides:
gnue.navigator.external.zope.interface.declarations.Declaration.__init__

__get__(self, inst, cls)

__reduce__(self)

Overrides:
__builtin__.object.__reduce__


GNUe Home

Private API

Developer's Corner