Пример #1
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')
Пример #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')
Пример #3
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
Пример #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