def available_location_types():
    """ List location types supported

    :returns: list of strings that represent the hierarchy of location types
        The first type is always the most broad. The last is always the most
        specific.
    :rtype: list
    """
    return _read_data_json('location_types.json')
示例#2
0
def available_location_types():
    """ List location types supported

    :returns: list of strings that represent the hierarchy of location types
        The first type is always the most broad. The last is always the most
        specific.
    :rtype: list
    """
    return _read_data_json('location_types.json')
def location_graph(use_cache=True):
    global _location_graph_cache

    location_mapping = _read_data_json('location_mapping.json')
    if not use_cache:
        return _convert_mapping_to_graph(location_mapping)

    if (_location_graph_cache.source != location_mapping):
        _location_graph_cache = GraphCache(
            source=location_mapping,
            graph=_convert_mapping_to_graph(location_mapping))
    return _location_graph_cache.graph
示例#4
0
def location_graph(use_cache=True):
    global _location_graph_cache

    location_mapping = _read_data_json('location_mapping.json')
    if not use_cache:
        return _convert_mapping_to_graph(location_mapping)

    if (_location_graph_cache.source != location_mapping):
        _location_graph_cache = GraphCache(
            source=location_mapping,
            graph=_convert_mapping_to_graph(location_mapping)
        )
    return _location_graph_cache.graph