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))
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)
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)
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))