# Path: mcloud/interrupt.py
# class InterruptCancel(Exception):
#     pass
# 
# Path: mcloud/rpc_client.py
# def format_epilog():
#     def __init__(self, config, command):
#     def call(self, to=None, **kwargs):
# def load_commands(config):
# def cli(help_, arguments=None, by_ref=False, name=None):
#     def cmd_decorator(func):
#         def _run(*args, **kwargs):
# def arg(*args, **kwargs):
#     def __init__(self, client):
#     def interrupt(self, last=None):
#     def __init__(self, host=None, port=None, settings=None):
#     def override_host(self, host):
#     def _remote_exec(self, task_name, *args, **kwargs):
#     def print_progress(self, message):
#     def _exec_remote_with_pty(self, task_name, *args):
#     def print_app_details(self, app):
#     def print_app_list(self, data):
#     def format_app_srv(self, app, service):
#     def format_domain(self, domain, ssl):
#     def parse_app_ref(self, ref, args, require_service=False, app_only=False, require_app=True, require_host=False):
#     def get_app(self, app_name):
#     def on_vars_result(self, data):
#     def get_volume_config(self, destination):
#         def on_result(volume_port):
#     def shell(self, **kwargs):
#     def list(self, follow=False, **kwargs):
#         def _print(data):
#     def init(self, ref, path, config=None, env=None, deployment=None, sync=False, **kwargs):
#     def represent_ordereddict(self, dumper, data):
#     def config(self, ref, diff=False, config=None, update=False, set_env=None, **kwargs):
#     def remove(self, ref, **kwargs):
#     def set_deployment(self, ref, deployment, **kwargs):
#     def start(self, ref, init=False, env=None, deployment=None, **kwargs):
#     def create(self, ref, **kwargs):
#     def destroy(self, ref, scrub_data, **kwargs):
#     def restart(self, ref, **kwargs):
#     def rebuild(self, ref, scrub_data, **kwargs):
#     def stop(self, ref, **kwargs):
#     def status(self, ref, follow=False, **kwargs):
#         def _print(data):
#     def machine(self, command, **kwargs):
#     def deployments(self, **kwargs):
#     def deployment_create(self, deployment, ip_host=None, port=None, tls=None, local=True, **kwargs):
#     def deployment_update(self, deployment, ip_host=None, port=None, tls=None, local=None, **kwargs):
#     def deployment_set_default(self, deployment, host, **kwargs):
#     def deployment_set(self, deployment, ca=False, cert=False, key=False, infile=None, remove=None, **kwargs):
#     def deployment_remove(self, deployment, **kwargs):
#     def publish(self, ref, domain, ssl=False, port=None, **kwargs):
#     def unpublish(self, ref, domain, ssl=False, **kwargs):
#     def run(self, ref, command, no_tty=False, **kwargs):
#     def logs(self, ref, follow=False, **kwargs):
#     def inspect(self, ref, **kwargs):
#     def push(self, volume, host, **kwargs):
#     def sync(self, source, destination, **kwargs):
#     def backup(self, source, volume, destination, **kwargs):
#     def restore(self, source, volume, destination, **kwargs):
#     def set(self, name, val, **kwargs):
#     def unset(self, name, **kwargs):
#     def vars(self, **kwargs):
#     def clean(self, **kwargs):
#     def dns(self, **kwargs):
#     def ps(self, **kwargs):
#     def kill(self, task_id=None, **kwargs):
# class LocalCommand(object):
# class CommandFailedException(Exception):
# class ClientProcessInterruptHandler(object):
# class ApiRpcClient(object):


import sys
import readline
import inject
import os
from autobahn.twisted.util import sleep
from bashutils.colors import color_text
from mcloud.interrupt import InterruptCancel
from mcloud.rpc_client import subparsers, arg_parser, ApiRpcClient, ClientProcessInterruptHandler
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
    from mcloud.logo import logo

            params = line.split(' ')
            args = arg_parser.parse_args(params)

            args.argv0 = sys.argv[0]

            if args.host:
                host = args.host
            elif state['host'] == 'me' or not state['host']:
                # manual variable
                if 'MCLOUD_HOST' in os.environ:
                    host = os.environ['MCLOUD_HOST']

                # automatic when using docker container-link
                elif 'MCLOUD_PORT' in os.environ:
                    host = os.environ['MCLOUD_PORT']
                    if host.startswith('tcp://'):
                        host = host[6:]
                else:
                    host = '127.0.0.1'

            else:
                host = state['host']

            if ':' in host:
                host, port = host.split(':')
            else:
                port = 7080

            client = ApiRpcClient(host=host, port=port, settings=settings)

# Path: mcloud/interrupt.py
# class InterruptCancel(Exception):
#     pass
# 
# Path: mcloud/rpc_client.py
# def format_epilog():
#     def __init__(self, config, command):
#     def call(self, to=None, **kwargs):
# def load_commands(config):
# def cli(help_, arguments=None, by_ref=False, name=None):
#     def cmd_decorator(func):
#         def _run(*args, **kwargs):
# def arg(*args, **kwargs):
#     def __init__(self, client):
#     def interrupt(self, last=None):
#     def __init__(self, host=None, port=None, settings=None):
#     def override_host(self, host):
#     def _remote_exec(self, task_name, *args, **kwargs):
#     def print_progress(self, message):
#     def _exec_remote_with_pty(self, task_name, *args):
#     def print_app_details(self, app):
#     def print_app_list(self, data):
#     def format_app_srv(self, app, service):
#     def format_domain(self, domain, ssl):
#     def parse_app_ref(self, ref, args, require_service=False, app_only=False, require_app=True, require_host=False):
#     def get_app(self, app_name):
#     def on_vars_result(self, data):
#     def get_volume_config(self, destination):
#         def on_result(volume_port):
#     def shell(self, **kwargs):
#     def list(self, follow=False, **kwargs):
#         def _print(data):
#     def init(self, ref, path, config=None, env=None, deployment=None, sync=False, **kwargs):
#     def represent_ordereddict(self, dumper, data):
#     def config(self, ref, diff=False, config=None, update=False, set_env=None, **kwargs):
#     def remove(self, ref, **kwargs):
#     def set_deployment(self, ref, deployment, **kwargs):
#     def start(self, ref, init=False, env=None, deployment=None, **kwargs):
#     def create(self, ref, **kwargs):
#     def destroy(self, ref, scrub_data, **kwargs):
#     def restart(self, ref, **kwargs):
#     def rebuild(self, ref, scrub_data, **kwargs):
#     def stop(self, ref, **kwargs):
#     def status(self, ref, follow=False, **kwargs):
#         def _print(data):
#     def machine(self, command, **kwargs):
#     def deployments(self, **kwargs):
#     def deployment_create(self, deployment, ip_host=None, port=None, tls=None, local=True, **kwargs):
#     def deployment_update(self, deployment, ip_host=None, port=None, tls=None, local=None, **kwargs):
#     def deployment_set_default(self, deployment, host, **kwargs):
#     def deployment_set(self, deployment, ca=False, cert=False, key=False, infile=None, remove=None, **kwargs):
#     def deployment_remove(self, deployment, **kwargs):
#     def publish(self, ref, domain, ssl=False, port=None, **kwargs):
#     def unpublish(self, ref, domain, ssl=False, **kwargs):
#     def run(self, ref, command, no_tty=False, **kwargs):
#     def logs(self, ref, follow=False, **kwargs):
#     def inspect(self, ref, **kwargs):
#     def push(self, volume, host, **kwargs):
#     def sync(self, source, destination, **kwargs):
#     def backup(self, source, volume, destination, **kwargs):
#     def restore(self, source, volume, destination, **kwargs):
#     def set(self, name, val, **kwargs):
#     def unset(self, name, **kwargs):
#     def vars(self, **kwargs):
#     def clean(self, **kwargs):
#     def dns(self, **kwargs):
#     def ps(self, **kwargs):
#     def kill(self, task_id=None, **kwargs):
# class LocalCommand(object):
# class CommandFailedException(Exception):
# class ClientProcessInterruptHandler(object):
# class ApiRpcClient(object):


# Path: mcloud/shell.py
import sys
import readline
import inject
import os
from autobahn.twisted.util import sleep
from bashutils.colors import color_text
from mcloud.interrupt import InterruptCancel
from mcloud.rpc_client import subparsers, arg_parser, ApiRpcClient, ClientProcessInterruptHandler
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
    from mcloud.logo import logo


            params = line.split(' ')
            args = arg_parser.parse_args(params)

            args.argv0 = sys.argv[0]

            if args.host:
                host = args.host
            elif state['host'] == 'me' or not state['host']:
                # manual variable
                if 'MCLOUD_HOST' in os.environ:
                    host = os.environ['MCLOUD_HOST']

                # automatic when using docker container-link
                elif 'MCLOUD_PORT' in os.environ:
                    host = os.environ['MCLOUD_PORT']
                    if host.startswith('tcp://'):
                        host = host[6:]
                else:
                    host = '127.0.0.1'

            else:
                host = state['host']

            if ':' in host:
                host, port = host.split(':')
            else:
                port = 7080

            client = ApiRpcClient(host=host, port=port, settings=settings)

            interrupt_manager.append(ClientProcessInterruptHandler(client))