Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
ó
¹EYc@sydZddlZddlZddlZddlmZejeƒZde	fd„ƒYZ
de	fd„ƒYZdS(	sExtensionManager
iÿÿÿÿNi(t	NoMatchest	ExtensioncBs&eZdZd„Zed„ƒZRS(s•Book-keeping object for tracking extensions.

    The arguments passed to the constructor are saved as attributes of
    the instance using the same names, and can be accessed by the
    callables passed to :meth:`map` or when iterating over an
    :class:`ExtensionManager` directly.

    :param name: The entry point name.
    :type name: str
    :param entry_point: The EntryPoint instance returned by
        :mod:`pkg_resources`.
    :type entry_point: EntryPoint
    :param plugin: The value returned by entry_point.load()
    :param obj: The object returned by ``plugin(*args, **kwds)`` if the
                manager invoked the extension on load.

    cCs(||_||_||_||_dS(N(tnametentry_pointtplugintobj(tselfRRRR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pyt__init__-s			cCsd|jj|jjdfS(sÆThe module and attribute referenced by this extension's entry_point.

        :return: A string representation of the target of the entry point in
            'dotted.module:object' format.
        s%s:%si(Rtmodule_nametattrs(R((sH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pytentry_point_target3s(t__name__t
__module__t__doc__RtpropertyR
(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pyRs	tExtensionManagercBsÔeZdZedieded„Zededed„ƒZedd„Zd„Z	iZ
d„Zd„Zd„Z
d	„Zd
„Zd„Zed„ƒZd
„Zd„Zd„Zd„Zd„ZRS(sWBase class for all of the other managers.

    :param namespace: The namespace for the entry points.
    :type namespace: str
    :param invoke_on_load: Boolean controlling whether to invoke the
        object returned by the entry point after the driver is loaded.
    :type invoke_on_load: bool
    :param invoke_args: Positional arguments to pass when invoking
        the object returned by the entry point. Only used if invoke_on_load
        is True.
    :type invoke_args: tuple
    :param invoke_kwds: Named arguments to pass when invoking
        the object returned by the entry point. Only used if invoke_on_load
        is True.
    :type invoke_kwds: dict
    :param propagate_map_exceptions: Boolean controlling whether exceptions
        are propagated up through the map call or whether they are logged and
        then ignored
    :type propagate_map_exceptions: bool
    :param on_load_failure_callback: Callback function that will be called when
        a entrypoint can not be loaded. The arguments that will be provided
        when this is called (when an entrypoint fails to load) are
        (manager, entrypoint, exception)
    :type on_load_failure_callback: function
    :param verify_requirements: Use setuptools to enforce the
        dependencies of the plugin(s) being loaded. Defaults to False.
    :type verify_requirements: bool
    c	CsB|j|d|d|ƒ|j||||ƒ}|j|ƒdS(Ntpropagate_map_exceptionston_load_failure_callback(t_init_attributest
_load_pluginst
_init_plugins(	Rt	namespacetinvoke_on_loadtinvoke_argstinvoke_kwdsRRtverify_requirementst
extensions((sH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pyR\s		tTESTINGcCs9|j|ƒ}|j|d|d|ƒ|j|ƒ|S(sConstruct a test ExtensionManager

        Test instances are passed a list of extensions to work from rather
        than loading them from entry points.

        :param extensions: Pre-configured Extension instances to use
        :type extensions: list of :class:`~stevedore.extension.Extension`
        :param namespace: The namespace for the manager; used only for
            identification since the extensions are passed in.
        :type namespace: str
        :param propagate_map_exceptions: When calling map, controls whether
            exceptions are propagated up through the map call or whether they
            are logged and then ignored
        :type propagate_map_exceptions: bool
        :param on_load_failure_callback: Callback function that will
            be called when a entrypoint can not be loaded. The
            arguments that will be provided when this is called (when
            an entrypoint fails to load) are (manager, entrypoint,
            exception)
        :type on_load_failure_callback: function
        :param verify_requirements: Use setuptools to enforce the
            dependencies of the plugin(s) being loaded. Defaults to False.
        :type verify_requirements: bool
        :return: The manager instance, initialized for testing

        RR(t__new__RR(tclsRRRRRto((sH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pytmake_test_instancems 
cCs||_||_||_dS(N(RRt_on_load_failure_callback(RRRR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pyR”s		cCs||_d|_dS(N(RtNonet_extensions_by_name(RR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pyRšs	cCsK|j|jkr=ttj|jƒƒ}||j|j<n|j|jS(sžReturn the list of entry points for this namespace.

        The entry points are not actually loaded, their list is just read and
        returned.

        (RtENTRY_POINT_CACHEtlistt
pkg_resourcestiter_entry_points(Rteps((sH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pytlist_entry_points scCs"tttjdƒ|jƒƒƒS(s9Return the list of entry points names for this namespace.R(R$tmaptoperatort
attrgetterR((R((sH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pytentry_points_names¬sc	Csâg}xÕ|jƒD]Ç}tjd|ƒy5|j|||||ƒ}|r]|j|ƒnWqttfk
rz‚qtk
rÙ}|jdk	r®|j|||ƒqÚtj
d|j|dtjt
jƒƒqXqW|S(Nsfound extension %rsCould not load %r: %stexc_info(R(tLOGtdebugt_load_one_plugintappendtKeyboardInterrupttAssertionErrort	ExceptionR R!terrorRtisEnabledFortloggingtDEBUG(	RRRRRRteptextterr((sH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pyR°s&			cCs†t|dƒr@t|dƒr@|r1|jƒn|jƒ}n|jd|ƒ}|rj|||Ž}nd}t|j|||ƒS(Ntresolvetrequire(thasattrR=R<tloadR!RR(RR9RRRRRR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pyR0Ïs
cCsg|jD]}|j^q
S(s.Returns the names of the discovered extensions(RR(Rte((sH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pytnamesßscOsY|jstd|jƒ‚ng}x-|jD]"}|j|j||||ƒq/W|S(s¹Iterate over the extensions invoking func() for each.

        The signature for func() should be::

            def func(ext, *args, **kwds):
                pass

        The first argument to func(), 'ext', is the
        :class:`~stevedore.extension.Extension` instance.

        Exceptions raised from within func() are propagated up and
        processing stopped if self.propagate_map_exceptions is True,
        otherwise they are logged and ignored.

        :param func: Callable to invoke for each extension.
        :param args: Variable arguments to pass to func()
        :param kwds: Keyword arguments to pass to func()
        :returns: List of values returned from func()
        sNo %s extensions found(RRRt_invoke_one_pluginR1(RtfunctargstkwdstresponseR@((sH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pyR)æs	 cOst|j|ƒ||ŽS(N(tgetattrR(t	extensiontmethod_nameRDRE((sH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pyt_call_extension_methodscOs|j|j|||ŽS(sÊIterate over the extensions invoking a method by name.

        This is equivalent of using :meth:`map` with func set to
        `lambda x: x.obj.method_name()`
        while being more convenient.

        Exceptions raised from within the called method are propagated up
        and processing stopped if self.propagate_map_exceptions is True,
        otherwise they are logged and ignored.

        .. versionadded:: 0.12

        :param method_name: The extension method name
                            to call for each extension.
        :param args: Variable arguments to pass to method
        :param kwds: Keyword arguments to pass to method
        :returns: List of values returned from methods
        (R)RJ(RRIRDRE((sH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pyt
map_methodscCsfy|||||ŽƒWnEtk
ra}|jr;‚qbtjd|j|ƒtj|ƒnXdS(Nserror calling %r: %s(R4RR.R5Rt	exception(Rtresponse_callbackRCR@RDRER;((sH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pyRBs	cCs
t|jƒS(s¬Produce iterator for the manager.

        Iterating over an ExtensionManager produces the :class:`Extension`
        instances in the order they would be invoked.
        (titerR(R((sH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pyt__iter__&scCsM|jdkrBi}x|jD]}|||j<qW||_n|j|S(s¾Return the named extension.

        Accessing an ExtensionManager as a dictionary (``em['name']``)
        produces the :class:`Extension` instance with the
        specified name.
        N(R"R!RR(RRtdR@((sH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pyt__getitem__.scst‡fd†|jDƒƒS(s>Return true if name is in list of enabled extensions.
        c3s|]}|jˆkVqdS(N(R(t.0RH(R(sH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pys	<genexpr>?s(tanyR(RR((RsH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pyt__contains__<s(N(RRR
tFalseR!RtclassmethodRRRR#R(R,RR0RAR)tstaticmethodRJRKRBRORQRT(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pyR>s8#									
		(R
R*R%R7RLRt	getLoggerRR.tobjectRR(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/stevedore/extension.pyt<module>s$