コード例 #1
0
def cli(ctx: click.core.Context, url: str, request_id: str) -> None:
    """Python library for convenient access to the iov42 platform.."""
    ctx.ensure_object(dict)
    # TODO: lazy creation of identity for the 'create identity' command. For now
    # we provide a dummy identity which will replaced at a later stage.
    ctx.obj["url"] = url
    ctx.obj["request_id"] = request_id
コード例 #2
0
def main(ctx: click.core.Context, db: str):
    """tasks3 is a commandline tool to create and manage tasks and todo lists"""

    ctx.ensure_object(dict)

    ctx.obj["DB"] = db
    return 0
コード例 #3
0
ファイル: cli.py プロジェクト: wikimedia/poppy-cli
def main(ctx: click.core.Context, broker_url: str, queue_name: str,
         connection_timeout: int):
    """Simple CLI for messaging"""

    ctx.ensure_object(dict)
    ctx.obj["BROKER_URL"] = broker_url
    ctx.obj["QUEUE_NAME"] = queue_name
    ctx.obj["CONNECTION_TIMEOUT"] = connection_timeout
コード例 #4
0
ファイル: cli.py プロジェクト: std0/pycrypt
def cli(ctx: click.core.Context, encrypt: bool, input_file: TextIO,
        output_file: TextIO) -> None:
    """Allows to encrypt or decrypt plain text or text files with
    various ciphers."""
    ctx.ensure_object(dict)

    ctx.obj['is_encrypt'] = encrypt

    if input_file is None:
        input_text = click.prompt("Enter input")
        ctx.obj['input_stream'] = StringIO(input_text)
    else:
        ctx.obj['input_stream'] = input_file
        print("Input loaded from {0}".format(input_file.name))

    if output_file is None:
        ctx.obj['output_stream'] = StringIO()
    else:
        ctx.obj['output_stream'] = output_file

    ctx.obj['to_stdout'] = output_file is None
コード例 #5
0
def main(ctx: click.core.Context) -> None:
    print('---> main')
    # ensure that ctx.obj exists and is a dict
    ctx.ensure_object(dict)
コード例 #6
0
def main(ctx: click.core.Context) -> None:
    """ Defines a group of commands """
    ctx.ensure_object(dict)