404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.147.8.200: ~ $
3

,�W A�@s�dZddlmZddlmZddlmZddlmZddlmZddlmZddlm	Z	dd	lm
Z
dd
lmZddlmZddlm
Z
dd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZGdd�de�ZGdd�de�ZGdd�de�ZGdd �d e�ZGd!d"�d"e�ZGd#d$�d$e �Z!Gd%d&�d&e�Z"d'S)(z0Component and Component Architecture Interfaces
�)�	Attribute)�	Interface)�
implements)�ComponentLookupError)�Invalid)�IObjectEvent)�ObjectEvent)�IComponentLookup)�
IRegistration)�IUtilityRegistration)�_IBaseAdapterRegistration)�IAdapterRegistration)� ISubscriptionAdapterRegistration)�IHandlerRegistration)�IRegistrationEvent)�RegistrationEvent)�IRegistered)�
Registered)�
IUnregistered)�Unregistered)�IComponentRegistry)�IComponents)�_BLANKc@s�eZdZdZdd�Zd.dd�Zd/dd	�Zd0d
d�Zd1dd
�Zd2dd�Z	d3dd�Z
d4dd�Zee
dfdd�Zdd�Zeddfdd�Zee
ddfdd�Zd5dd�Zee
ddfdd�Zd6d d!�Zd7d"d#�Zd$d%�Zd&d'�Zd(d)�Zd8d*d+�Zd9d,d-�ZdS):�IComponentArchitecturez�The Component Architecture is defined by two key components: Adapters
    and Utiltities. Both are managed by site managers. All other components
    build on top of them.
    cCsdS)z�Return the global site manager.

        This function should never fail and always return an object that
        provides `IGlobalSiteManager`.
        N�rrr� /usr/lib/python3.6/interfaces.py�getGlobalSiteManager3sz+IComponentArchitecture.getGlobalSiteManagerNcCsdS)aHGet the nearest site manager in the given context.

        If `context` is `None`, return the global site manager.

        If the `context` is not `None`, it is expected that an adapter
        from the `context` to `IComponentLookup` can be found. If no
        adapter is found, a `ComponentLookupError` is raised.

        Nr)�contextrrr�getSiteManager:sz%IComponentArchitecture.getSiteManager�cCsdS)z�Get the utility that provides interface

        Returns the nearest utility to the context that implements the
        specified interface.  If one is not found, raises
        ComponentLookupError.
        Nr)�	interface�namerrrr�
getUtilityGsz!IComponentArchitecture.getUtilitycCsdS)z�Look for the utility that provides interface

        Returns the nearest utility to the context that implements
        the specified interface.  If one is not found, returns default.
        Nr)r r!�defaultrrrr�queryUtilityOsz#IComponentArchitecture.queryUtilitycCsdS)z�Query for the next available utility.
    
        Find the next available utility providing `interface` and having the
        specified name. If no utility was found, return the specified `default`
        value.
        Nr)rr r!r#rrr�queryNextUtilityVsz'IComponentArchitecture.queryNextUtilitycCsdS)zrGet the next available utility.
    
        If no utility was found, a `ComponentLookupError` is raised.
        Nr)rr r!rrr�getNextUtility^sz%IComponentArchitecture.getNextUtilitycCsdS)zuReturn the utilities that provide an interface

        An iterable of utility name-value pairs is returned.
        Nr)r rrrr�getUtilitiesFordsz&IComponentArchitecture.getUtilitiesForcCsdS)z�Return all registered utilities for an interface

        This includes overridden utilities.

        An iterable of utility instances is returned.  No names are
        returned.
        Nr)r rrrr�getAllUtilitiesRegisteredForjsz3IComponentArchitecture.getAllUtilitiesRegisteredForcCsdS)a�Get a named adapter to an interface for an object

        Returns an adapter that can adapt object to interface.  If a matching
        adapter cannot be found, raises ComponentLookupError.

        If context is None, an application-defined policy is used to choose
        an appropriate service manager from which to get an 'Adapters' service.

        If 'context' is not None, context is adapted to IServiceService,
        and this adapter's 'Adapters' service is used.
        Nr)�objectr r!rrrr�
getAdapterusz!IComponentArchitecture.getAdaptercCsdS)a)Get a special adapter to an interface for an object

        NOTE: This method should only be used if a custom context
        needs to be provided to provide custom component
        lookup. Otherwise, call the interface, as in::

           interface(object)

        Returns an adapter that can adapt object to interface.  If a matching
        adapter cannot be found, raises ComponentLookupError.

        Context is adapted to IServiceService, and this adapter's
        'Adapters' service is used.

        If the object has a __conform__ method, this method will be
        called with the requested interface.  If the method returns a
        non-None value, that value will be returned. Otherwise, if the
        object already implements the interface, the object will be
        returned.
        Nr)r)r rrrr�getAdapterInContext�sz*IComponentArchitecture.getAdapterInContextcCsdS)a�Look for a multi-adapter to an interface for an objects

        Returns a multi-adapter that can adapt objects to interface.  If a
        matching adapter cannot be found, raises ComponentLookupError.

        If context is None, an application-defined policy is used to choose
        an appropriate service manager from which to get an 'Adapters' service.

        If 'context' is not None, context is adapted to IServiceService,
        and this adapter's 'Adapters' service is used.

        The name consisting of an empty string is reserved for unnamed
        adapters. The unnamed adapter methods will often call the
        named adapter methods with an empty string for a name.
        Nr)�objectsr r!rrrr�getMultiAdapter�sz&IComponentArchitecture.getMultiAdaptercCsdS)a�Look for a named adapter to an interface for an object

        Returns an adapter that can adapt object to interface.  If a matching
        adapter cannot be found, returns the default.

        If context is None, an application-defined policy is used to choose
        an appropriate service manager from which to get an 'Adapters' service.

        If 'context' is not None, context is adapted to IServiceService,
        and this adapter's 'Adapters' service is used.
        Nr)r)r r!r#rrrr�queryAdapter�sz#IComponentArchitecture.queryAdaptercCsdS)a/Look for a special adapter to an interface for an object

        NOTE: This method should only be used if a custom context
        needs to be provided to provide custom component
        lookup. Otherwise, call the interface, as in::

           interface(object, default)

        Returns an adapter that can adapt object to interface.  If a matching
        adapter cannot be found, returns the default.

        Context is adapted to IServiceService, and this adapter's
        'Adapters' service is used.

        If the object has a __conform__ method, this method will be
        called with the requested interface.  If the method returns a
        non-None value, that value will be returned. Otherwise, if the
        object already implements the interface, the object will be
        returned.
        Nr)r)r rr#rrr�queryAdapterInContext�sz,IComponentArchitecture.queryAdapterInContextcCsdS)a�Look for a multi-adapter to an interface for objects

        Returns a multi-adapter that can adapt objects to interface.  If a
        matching adapter cannot be found, returns the default.

        If context is None, an application-defined policy is used to choose
        an appropriate service manager from which to get an 'Adapters' service.

        If 'context' is not None, context is adapted to IServiceService,
        and this adapter's 'Adapters' service is used.

        The name consisting of an empty string is reserved for unnamed
        adapters. The unnamed adapter methods will often call the
        named adapter methods with an empty string for a name.
        Nr)r,r r!r#rrrr�queryMultiAdapter�sz(IComponentArchitecture.queryMultiAdaptercCsdS)a�Look for all matching adapters to a provided interface for objects

        Return a list of adapters that match. If an adapter is named, only the
        most specific adapter of a given name is returned.

        If context is None, an application-defined policy is used to choose
        an appropriate service manager from which to get an 'Adapters'
        service.

        If 'context' is not None, context is adapted to IServiceService,
        and this adapter's 'Adapters' service is used.
        Nr)r,�providedrrrr�getAdapters�sz"IComponentArchitecture.getAdapterscCsdS)a�Get subscribers

        Subscribers are returned that provide the provided interface
        and that depend on and are computed from the sequence of
        required objects.

        If context is None, an application-defined policy is used to choose
        an appropriate service manager from which to get an 'Adapters'
        service.

        If 'context' is not None, context is adapted to IServiceService,
        and this adapter's 'Adapters' service is used.
        Nr)Zrequiredr1rrrr�subscribers�sz"IComponentArchitecture.subscriberscGsdS)z�Call all of the handlers for the given objects

        Handlers are subscription adapter factories that don't produce
        anything.  They do all of their work when called.  Handlers
        are typically used to handle events.

        Nr)r,rrr�handleszIComponentArchitecture.handlecGsdS)z�Declare that a class adapts the given interfaces.

        This function can only be used in a class definition.

        (TODO, allow classes to be passed as well as interfaces.)
        Nr)Z
interfacesrrr�adaptsszIComponentArchitecture.adaptscOsdS)a�Create an object using a factory

        Finds the named factory in the current site and calls it with
        the given arguments.  If a matching factory cannot be found
        raises ComponentLookupError.  Returns the created object.

        A context keyword argument can be provided to cause the
        factory to be looked up in a location other than the current
        site.  (Of course, this means that it is impossible to pass a
        keyword argument named "context" to the factory.
        Nr)Zfactory_name�args�kwargsrrr�createObjectsz#IComponentArchitecture.createObjectcCsdS)z�Get interfaces implemented by a factory

        Finds the factory of the given name that is nearest to the
        context, and returns the interface or interface tuple that
        object instances created by the named factory will implement.
        Nr)r!rrrr�getFactoryInterfaces#sz+IComponentArchitecture.getFactoryInterfacescCsdS)z�Return a tuple (name, factory) of registered factories that
        create objects which implement the given interface.
        Nr)r rrrr�getFactoriesFor+sz&IComponentArchitecture.getFactoriesFor)N)rN)rNN)rN)r)N)N)N)N)N)N)N)�__name__�
__module__�__qualname__�__doc__rrr"r$r%r&r'r(rrr*r+r-r.r/r0r2r3r4r5r8r9r:rrrrr,s6













rc@seZdZdZdd�ZdS)�	IRegistryz,Object that supports component registry
    cCsdS)z6Return an iterable of component registrations
        Nrrrrr�
registrations5szIRegistry.registrationsN)r;r<r=r>r@rrrrr?1sr?c@sBeZdZdZdefdd�Zddefdd�Zddd�Zdd	d
�ZdS)
�!IComponentRegistrationConveniencez�API for registering components.

    CAUTION: This API should only be used from test or
    application-setup code. This api shouldn't be used by regular
    library modules, as component registration is a configuration
    activity.
    NcCsdS)aBRegister a utility globally

        A utility is registered to provide an interface with a
        name. If a component provides only one interface, then the
        provides argument can be omitted and the provided interface
        will be used. (In this case, provides argument can still be
        provided to provide a less specific interface.)

        CAUTION: This API should only be used from test or
        application-setup code. This API shouldn't be used by regular
        library modules, as component registration is a configuration
        activity.

        Nr)Z	component�providesr!rrr�provideUtilityBsz0IComponentRegistrationConvenience.provideUtilitycCsdS)a=Register an adapter globally

        An adapter is registered to provide an interface with a name
        for some number of object types. If a factory implements only
        one interface, then the provides argument can be omitted and
        the provided interface will be used. (In this case, a provides
        argument can still be provided to provide a less specific
        interface.)

        If the factory has an adapts declaration, then the adapts
        argument can be omitted and the declaration will be used.  (An
        adapts argument can be provided to override the declaration.)

        CAUTION: This API should only be used from test or
        application-setup code. This API shouldn't be used by regular
        library modules, as component registration is a configuration
        activity.
        Nr)�factoryr5rBr!rrr�provideAdapterRsz0IComponentRegistrationConvenience.provideAdaptercCsdS)a@Register a subscription adapter

        A subscription adapter is registered to provide an interface
        for some number of object types. If a factory implements only
        one interface, then the provides argument can be omitted and
        the provided interface will be used. (In this case, a provides
        argument can still be provided to provide a less specific
        interface.)

        If the factory has an adapts declaration, then the adapts
        argument can be omitted and the declaration will be used.  (An
        adapts argument can be provided to override the declaration.)

        CAUTION: This API should only be used from test or
        application-setup code. This API shouldn't be used by regular
        library modules, as component registration is a configuration
        activity.
        Nr)rDr5rBrrr�provideSubscriptionAdapterfsz<IComponentRegistrationConvenience.provideSubscriptionAdaptercCsdS)a~Register a handler

        Handlers are subscription adapter factories that don't produce
        anything.  They do all of their work when called.  Handlers
        are typically used to handle events.

        If the handler has an adapts declaration, then the adapts
        argument can be omitted and the declaration will be used.  (An
        adapts argument can be provided to override the declaration.)

        CAUTION: This API should only be used from test or
        application-setup code. This API shouldn't be used by regular
        library modules, as component registration is a configuration
        activity.
        Nr)Zhandlerr5rrr�provideHandlerzsz0IComponentRegistrationConvenience.provideHandler)NN)N)	r;r<r=r>rrCrErFrGrrrrrA9s

rAc@s eZdZdZdd�Zdd�ZdS)�
IPossibleSitez$An object that could be a site.
    cCsdS)z/Sets the site manager for this object.
        Nr)Zsitemanagerrrr�setSiteManager�szIPossibleSite.setSiteManagercCsdS)z}Returns the site manager contained in this object.

        If there isn't a site manager, raise a component lookup.
        Nrrrrrr�szIPossibleSite.getSiteManagerN)r;r<r=r>rIrrrrrrH�srHc@seZdZdZdS)�ISitez0Marker interface to indicate that we have a siteN)r;r<r=r>rrrrrJ�srJc@seZdZdZdS)�Misusedz?A component is being used (registered) for the wrong interface.N)r;r<r=r>rrrrrK�srKc@s0eZdZdZed�Zed�Zdd�Zdd�ZdS)	�IFactoryz7A factory is responsible for creating other components.zThe factory title.z#A brief description of the factory.cOsdS)z6Return an instance of the objects we're a factory for.Nr)r6�kwrrr�__call__�szIFactory.__call__cCsdS)aGet the interfaces implemented by the factory

        Return the interface(s), as an instance of Implements, that objects
        created by this factory will implement. If the callable's Implements
        instance cannot be created, an empty Implements instance is returned.
        Nrrrrr�
getInterfaces�szIFactory.getInterfacesN)	r;r<r=r>r�title�descriptionrNrOrrrrrL�s
rLN)#r>Zzope.interfacerrrZzope.interface.interfacesrrrrr	r
rrr
rrrrrrrrrrZzope.component._compatrrr?rArHrJ�	ExceptionrKrLrrrr�<module>s@S

Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 1.74 KB 0644
__init__.cpython-36.pyc File 1.74 KB 0644
_api.cpython-36.opt-1.pyc File 5.66 KB 0644
_api.cpython-36.pyc File 5.66 KB 0644
_compat.cpython-36.opt-1.pyc File 337 B 0644
_compat.cpython-36.pyc File 337 B 0644
_declaration.cpython-36.opt-1.pyc File 1.76 KB 0644
_declaration.cpython-36.pyc File 1.76 KB 0644
event.cpython-36.opt-1.pyc File 796 B 0644
event.cpython-36.pyc File 796 B 0644
eventtesting.cpython-36.opt-1.pyc File 1.55 KB 0644
eventtesting.cpython-36.pyc File 1.55 KB 0644
factory.cpython-36.opt-1.pyc File 1.44 KB 0644
factory.cpython-36.pyc File 1.44 KB 0644
globalregistry.cpython-36.opt-1.pyc File 2.78 KB 0644
globalregistry.cpython-36.pyc File 2.78 KB 0644
hookable.cpython-36.opt-1.pyc File 1.22 KB 0644
hookable.cpython-36.pyc File 1.22 KB 0644
hooks.cpython-36.opt-1.pyc File 3.19 KB 0644
hooks.cpython-36.pyc File 3.19 KB 0644
interface.cpython-36.opt-1.pyc File 3.59 KB 0644
interface.cpython-36.pyc File 3.67 KB 0644
interfaces.cpython-36.opt-1.pyc File 18.51 KB 0644
interfaces.cpython-36.pyc File 18.51 KB 0644
persistentregistry.cpython-36.opt-1.pyc File 2 KB 0644
persistentregistry.cpython-36.pyc File 2 KB 0644
registry.cpython-36.opt-1.pyc File 1.51 KB 0644
registry.cpython-36.pyc File 1.51 KB 0644
security.cpython-36.opt-1.pyc File 2.49 KB 0644
security.cpython-36.pyc File 2.49 KB 0644
standalonetests.cpython-36.opt-1.pyc File 1.63 KB 0644
standalonetests.cpython-36.pyc File 1.7 KB 0644
testing.cpython-36.opt-1.pyc File 1.12 KB 0644
testing.cpython-36.pyc File 1.12 KB 0644
testlayer.cpython-36.opt-1.pyc File 4.63 KB 0644
testlayer.cpython-36.pyc File 4.63 KB 0644
zcml.cpython-36.opt-1.pyc File 13.83 KB 0644
zcml.cpython-36.pyc File 13.83 KB 0644