python类make_pass_decorator()的实例源码

__init__.py 文件源码 项目:linchpin 作者: CentOS-PaaS-SIG 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def init(ctx):
    """
    Initializes a linchpin project, which generates an example PinFile, and
    creates the necessary directory structure for topologies and layouts.

    ctx: Context object defined by the click.make_pass_decorator method
    """

    pf_w_path = _get_pinfile_path(exists=False)

    try:
        # lpcli.lp_init(pf_w_path, targets) # TODO implement targets option
        lpcli.lp_init(pf_w_path)
    except LinchpinError as e:
        ctx.log_state(e)
        sys.exit(1)
__init__.py 文件源码 项目:browserstacker 作者: Stranger6667 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def browserstacker_command(func):
    """
    Shortcut to define command for BrowserStacker.
    """
    pass_decorator = click.make_pass_decorator(APIWrapper)
    return cli.command()(pass_decorator(func))
cli_common.py 文件源码 项目:click_cli_frontend 作者: iluxame 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def context():
        """
        Configuration context holder
        """
        return click.make_pass_decorator(Context, ensure=True)
cliutils.py 文件源码 项目:edm2016 作者: Knewton 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def __init__(self):
        self.options = []
        self.pass_state = click.make_pass_decorator(State, ensure=True)


问题


面经


文章

微信
公众号

扫码关注公众号