Esempio n. 1
0
def rpc_client(config, method, arguments, style, async_rpc=False):
    from IPython import embed
    from infi.rpc import patched_ipython_getargspec_context
    from infi.app_repo.service import get_client
    from infi.app_repo.utils import pretty_print, jsonify_arguments

    client = get_client(config)
    from os import environ
    if method:
        pretty_print(getattr(client, method)(*jsonify_arguments(*arguments), async_rpc=async_rpc), style)
    else:
        with patched_ipython_getargspec_context(client):
            embed()
Esempio n. 2
0
def rpc_client(config, method, arguments, style, async_rpc=False):
    from IPython import embed
    from infi.rpc import patched_ipython_getargspec_context
    from infi.app_repo.service import get_client
    from infi.app_repo.utils import pretty_print, jsonify_arguments

    client = get_client(config)
    from os import environ
    if method:
        pretty_print(getattr(client, method)(*jsonify_arguments(*arguments), async_rpc=async_rpc), style)
    else:
        with patched_ipython_getargspec_context(client):
            embed()
Esempio n. 3
0
def show_remote_packages(config, remote_host, remote_index):
    from requests import get
    from infi.app_repo.utils import pretty_print
    pretty_print(get("http://{}/packages/{}/index/packages.json".format(remote_host, remote_index)).json())
Esempio n. 4
0
def show_packages(config, index_name):
    from infi.app_repo.utils import pretty_print, decode, read_file, path
    packages_json = path.join(config.packages_directory, index_name, 'index', 'packages.json')
    data = decode(read_file(packages_json))
    pretty_print(data)
Esempio n. 5
0
def show_remote_packages(config, remote_host, remote_index):
    from requests import get
    from infi.app_repo.utils import pretty_print
    pretty_print(get("http://{}/packages/{}/index/packages.json".format(remote_host, remote_index)).json())
Esempio n. 6
0
def show_packages(config, index_name):
    from infi.app_repo.utils import pretty_print, decode, read_file, path
    packages_json = path.join(config.packages_directory, index_name, 'index', 'packages.json')
    data = decode(read_file(packages_json))
    pretty_print(data)