コード例 #1
0
ファイル: parser.py プロジェクト: TobiasLohner/mapgen
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))
コード例 #2
0
ファイル: welt2000cup.py プロジェクト: XCSoar/mapgen
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)
コード例 #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)
コード例 #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))