#NEWLINE# def __init__( self , document = None , cache = True ) : #NEWLINE# #INDENT# self . cache = cache #NEWLINE# self . _waypoints = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . _routes = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . _tracks = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . type_handlers = { #NEWLINE# #INDENT# 'string' : ( lambda e : e . text ) , #NEWLINE# 'uri' : ( lambda e : e . text ) , #NEWLINE# 'datetime' : self . _parse_datetime_element , #NEWLINE# 'decimal' : self . _parse_decimal , #NEWLINE# 'dgpsid' : self . _parse_dgps_station , #NEWLINE# 'email' : self . _parse_email , #NEWLINE# 'link' : self . _parse_link , #NEWLINE# 'year' : self . _parse_int , #NEWLINE# 'waypoint' : self . _parse_waypoint , #NEWLINE# 'segment' : self . _parse_segment , #NEWLINE# 'unsigned' : self . _parse_unsigned , #NEWLINE# 'degrees' : self . _parse_degrees , #NEWLINE# 'fix' : cache . _parse_fix , #NEWLINE# 'extensions' : self . _parse_noop , #NEWLINE# #UNINDENT# } #NEWLINE# if ( document is not None ) : #NEWLINE# #INDENT# self . open ( document )