def dump_config(fo=stdout): config = { "id-file" : ID_FILE, "rc-dir" : RCDIR, "user-config" : USER_CONFIG, "default-config" : DEFAULT_CFG, "java" : JAVA, "selenium-jar" : SELENIUM_JAR, "log-file" : LOG_FILE, "appdir" : APPDIR, "frozen" : is_frozen(), "server-port" : SERVER_PORT, "proxy" : PROXY, } json.dump(config, fo, indent=4)
def construct_command_line(self, config): port = str(config.pop("port", 4444)) config.pop("force", 0) config["browser"] = config.get("browser", "firefox").lower() for key, value in config.items(): if value == "": del config[key] if value == "Any": config[key] = "" child_opts = ["-p", port] debug = config.pop("debug", False) if debug: child_opts.append("-debug") command = [PROXY, ] + child_opts + [json.dumps(config), ] if not is_frozen(): command.insert(0, executable) return command
def root_dir(): return APPDIR if is_frozen() else join(APPDIR, "controller")