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@s°dZddlZddlmZddlZddlmZmZm	Z	ej
eƒZdZ
iZdefd„ƒYZdejjfd	„ƒYZed
„Zd„ZdS(sÜDecorator and config option definitions for adding custom code (hooks)
around callables.

NOTE: as of Nova 13.0 hooks are DEPRECATED and will be removed in the
near future. You should not build any new code using this facility.

Any method may have the 'add_hook' decorator applied, which yields the
ability to invoke Hook objects before or after the method. (i.e. pre and
post)

Hook objects are loaded by HookLoaders.  Each named hook may invoke multiple
Hooks.

Example Hook object::

    | class MyHook(object):
    |    def pre(self, *args, **kwargs):
    |       # do stuff before wrapped callable runs
    |
    |   def post(self, rv, *args, **kwargs):
    |       # do stuff after wrapped callable runs

Example Hook object with function parameters::

    | class MyHookWithFunction(object):
    |   def pre(self, f, *args, **kwargs):
    |       # do stuff with wrapped function info
    |   def post(self, f, *args, **kwargs):
    |       # do stuff with wrapped function info

iÿÿÿÿN(tlog(t_t_LEt_LWs
nova.hookstFatalHookExceptioncBseZdZRS(s³Exception which should be raised by hooks to indicate that normal
    execution of the hooked function should be terminated. Raised exception
    will be logged and reraised.
    (t__name__t
__module__t__doc__(((s?/home/tvault/.virtenv/lib/python2.7/site-packages/nova/hooks.pyR=stHookManagercBs5eZd„Zdd„Zdd„Zdd„ZRS(cCs#tt|ƒjt|dtƒdS(sŠInvoke_on_load creates an instance of the Hook class

        :param name: The name of the hooks to load.
        :type name: str
        tinvoke_on_loadN(tsuperRt__init__tNStTrue(tselftname((s?/home/tvault/.virtenv/lib/python2.7/site-packages/nova/hooks.pyRFsc
CsN|dkr'tdƒ}t|ƒ‚nx |jD]}|j}t||dƒ}	|	r1tjtdƒƒtj	di|d6|d6|d6ƒy*|r¬|	|||Žn
|	||ŽWqFt
k
rtd	ƒ}tj|i|d6|d6|d6ƒ‚qFt
k
rBtd
ƒ}tj|i|d6|d6|d6ƒqFXq1q1WdS(Ntpretposts=Wrong type of hook method. Only 'pre' and 'post' type allowedsLHooks are deprecated as of Nova 13.0 and will be removed in a future releases'Running %(name)s %(type)s-hook: %(obj)sRttypetobjs7Fatal Exception running %(name)s %(type)s-hook: %(obj)ss1Exception running %(name)s %(type)s-hook: %(obj)s(sprespost(Rt
ValueErrort
extensionsRtgetattrtNonetLOGtwarningRtdebugRRt	exceptiont	Exception(
RRtmethod_typetargstkwargstfunctmsgteRthook_method((s?/home/tvault/.virtenv/lib/python2.7/site-packages/nova/hooks.pyt_runNs.		

cCs,|jd|ddd|d|d|ƒdS(s‰Execute optional pre methods of loaded hooks.

        :param name: The name of the loaded hooks.
        :param args: Positional arguments which would be transmitted into
                     all pre methods of loaded hooks.
        :param kwargs: Keyword args which would be transmitted into all pre
                       methods of loaded hooks.
        :param f: Target function.
        RRRRRR N(R$(RRRRtf((s?/home/tvault/.virtenv/lib/python2.7/site-packages/nova/hooks.pytrun_prems
!cCs3|jd|ddd|f|d|d|ƒdS(sÄExecute optional post methods of loaded hooks.

        :param name: The name of the loaded hooks.
        :param rv: Return values of target method call.
        :param args: Positional arguments which would be transmitted into
                     all post methods of loaded hooks.
        :param kwargs: Keyword args which would be transmitted into all post
                       methods of loaded hooks.
        :param f: Target function.
        RRRRRR N(R$(RRtrvRRR%((s?/home/tvault/.virtenv/lib/python2.7/site-packages/nova/hooks.pytrun_postzs"N(RRRRR$R&R((((s?/home/tvault/.virtenv/lib/python2.7/site-packages/nova/hooks.pyREs	
cs‡‡fd†}|S(sExecute optional pre and post methods around the decorated
    function.  This is useful for customization around callables.
    cs1ˆˆ_tjˆƒ‡‡‡fd†ƒ}|S(Ncsutjˆtˆƒƒ}d}ˆr-ˆ}n|jˆ||d|ƒˆ||Ž}|jˆ|||d|ƒ|S(NR%(t_HOOKSt
setdefaultRRR&R((RRtmanagertfunctionR'(R%Rt
pass_function(s?/home/tvault/.virtenv/lib/python2.7/site-packages/nova/hooks.pytinner‘s	(t
__hook_name__t	functoolstwraps(R%R.(RR-(R%s?/home/tvault/.virtenv/lib/python2.7/site-packages/nova/hooks.pytouterŽs	$((RR-R2((RR-s?/home/tvault/.virtenv/lib/python2.7/site-packages/nova/hooks.pytadd_hook‰scCstjƒdS(sClear loaded hooks.N(R)tclear(((s?/home/tvault/.virtenv/lib/python2.7/site-packages/nova/hooks.pytreset£s(RR0toslo_logRtloggingt	stevedoret	nova.i18nRRRt	getLoggerRRRR)RRthookRtFalseR3R5(((s?/home/tvault/.virtenv/lib/python2.7/site-packages/nova/hooks.pyt<module>.sD