def start_client(socket_name=None): """ Start a pymux client. When a socket_name has been given, connect to that client, otherwise start a server in the background and use that one. """ if not socket_name: socket_name = start_server(daemonized=True) loop.run_until_complete(_run(socket_name))
def start(name=sys.argv[0]): """ Entry point for a pymux client. """ a = docopt.docopt(__doc__.replace('pymux.py', name))#, version=__version__) if a['run']: start_standalone() elif a['server']: start_server() elif a['attach']: start_client() elif a['session-info']: pp = pprint.PrettyPrinter(indent=4) pp.pprint(session_info()) elif a['new-window']: new_window()