Ejemplo n.º 1
0
def parse_waypoint_file(filename, file):
    if filename.lower().endswith('.xcw') or filename.lower().endswith('.dat'):
        return parse_winpilot_waypoints(file)
    elif filename.lower().endswith('.cup'):
        return parse_seeyou_waypoints(file)
    else:
        raise RuntimeError('Waypoint file {} has an unsupported format.'.format(filename))
Ejemplo n.º 2
0
def get_database(dir_data, bounds = None):
    # Get Welt2000 cup file
    path = __get_database_file(dir_data)

    # Parse Welt2000 cup file
    with open(path, "r") as f:
        # Return parsed WaypointList
        return parse_seeyou_waypoints(f, bounds)
Ejemplo n.º 3
0
def get_database(dir_data, bounds=None):
    # Get Welt2000 cup file
    path = __get_database_file(dir_data)

    # Parse Welt2000 cup file
    with open(path, "r") as f:
        # Return parsed WaypointList
        return parse_seeyou_waypoints(f, bounds)
Ejemplo n.º 4
0
def parse_waypoint_file(filename, file=None):
    if not file:
        file = open(filename, 'r')

    if filename.lower().endswith('.xcw') or filename.lower().endswith('.dat'):
        return parse_winpilot_waypoints(file)
    elif filename.lower().endswith('.cup'):
        return parse_seeyou_waypoints(file)
    else:
        raise RuntimeError(
            'Waypoint file {} has an unsupported format.'.format(filename))