def download_server_details(server): """Ask server for details about itself: the build ID and the API command defs""" logger.info("Requesting available commands from server") from trustedanalytics.rest.jsonschema import get_command_def response = request_server_command_defs(server) server_version = get_version(response) commands_json_schema = response.json() # ensure the assignment to __commands_from_backend is the last line in this 'if' block before the fatal try: return server_version, [get_command_def(c) for c in commands_json_schema]
def cmd_repr(self, json_str): schema = json.loads(json_str) cmd = js.get_command_def(schema) print "#################################################################" print repr(cmd)