|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /usr/lib/python2.7/site-packages/click/ |
Upload File : |
�
./�_c @ s0 d d l Z d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m
Z
d d l m Z d d l m Z d d
l
m Z d d l m Z d � Z d
� Z e d � Z d � Z d d d � Z d d � Z d � Z d � Z d � Z d � Z d � Z d d � Z d � Z d S( i����N( t update_wrapperi ( t iteritems( t _check_for_unicode_literals( t Argument( t Command( t Group( t Option( t get_current_context( t echoc s � f d � } t | � � S( s] Marks a callback as wanting to receive the current context
object as first argument.
c s � t � | | � S( N( R ( t argst kwargs( t f( s1 /tmp/pip-install-sTXtzD/click/click/decorators.pyt new_func s ( R ( R R ( ( R s1 /tmp/pip-install-sTXtzD/click/click/decorators.pyt pass_context s c s � f d � } t | � � S( s� Similar to :func:`pass_context`, but only pass the object on the
context onwards (:attr:`Context.obj`). This is useful if that object
represents the state of a nested system.
c s � t � j | | � S( N( R t obj( R R
( R ( s1 /tmp/pip-install-sTXtzD/click/click/decorators.pyR s ( R ( R R ( ( R s1 /tmp/pip-install-sTXtzD/click/click/decorators.pyt pass_obj s c s � � f d � } | S( s. Given an object type this creates a decorator that will work
similar to :func:`pass_obj` but instead of passing the object of the
current context, it will find the innermost context of type
:func:`object_type`.
This generates a decorator that works roughly like this::
from functools import update_wrapper
def decorator(f):
@pass_context
def new_func(ctx, *args, **kwargs):
obj = ctx.find_object(object_type)
return ctx.invoke(f, obj, *args, **kwargs)
return update_wrapper(new_func, f)
return decorator
:param object_type: the type of the object to pass.
:param ensure: if set to `True`, a new object will be created and
remembered on the context if it's not there yet.
c s"