Did I find the right examples for you? yes no

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)

        def read_config_json(name, path_or_url):

    try:
        log_verbose("Reading %s configuration"
                    " from '%s'..." % (name, path_or_url))

        json_str = read_json_string(path_or_url)
        # minify the json/remove comments and sh*t
        json_str = minify_json.json_minify(json_str)
        json_val =json.loads(json_str,
                             object_hook=json_util.object_hook)

        if not json_val and not isinstance(json_val,list): # b/c [] is not True
            raise MongoctlException("Unable to load %s "
                                    "config file: %s" % (name, path_or_url))
        else:
            return json_val
    except MongoctlException,e:
        raise e
    except Exception, e:
        raise MongoctlException("Unable to load %s "
                                "config file: %s: %s" % (name, path_or_url, e))
        


src/m/o/mongoctl-HEAD/mongoctl/repository.py   mongoctl(Download)
                                                 DEFAULT_SERVERS_FILE)
 
        server_documents = config.read_config_json("servers",
                                                   servers_path_or_url)
        if not isinstance(server_documents, list):
                                                  DEFAULT_CLUSTERS_FILE)
 
        cluster_documents = config.read_config_json("clusters",
                                                    clusters_path_or_url)
        if not isinstance(cluster_documents, list):