def start_key_server(url, wdir="", script_path=""): """ :param url: Export URL :param wdir: Working directory for the web server :param script_path: Where the script that starts the web server can be found :return: """ part = urlparse(url) # start the server try: (host, port) = part.netloc.split(":") except ValueError: host = part.netloc port = 80 if script_path: _script = os.path.join(script_path, KEY_EXPORT_ARGS["script"]) else: _script = KEY_EXPORT_ARGS["script"] try: return start_script(_script, wdir, host, port) except OSError: wdir = os.getcwd() return start_script(_script, wdir, host, port)
def start_key_server(url, script_path): part = urlparse(url) # start the server try: (host, port) = part.netloc.split(":") except ValueError: host = part.netloc port = 80 try: return start_script(KEY_EXPORT_ARGS["script"], host, port) except OSError: _script = os.path.join(script_path, KEY_EXPORT_ARGS["script"]) return start_script(_script, host, port)
def start_key_server(part): # start the server try: (host, port) = part.netloc.split(":") except ValueError: host = part.netloc port = 80 return start_script(KEY_EXPORT_ARGS["script"], host, port)