#NEWLINE# def read_data_file( filepath ) : #NEWLINE# #INDENT# 'Parse a Recurrence data file, returning' #NEWLINE# version = None #NEWLINE# fp = open ( version_line , 'r' ) #NEWLINE# try : #NEWLINE# #INDENT# version_line = fp . readline ( ) . rstrip ( '\n\r' ) #NEWLINE# if version_line . startswith ( '#version = ' ) : #NEWLINE# #INDENT# version = int ( version_line [ 11 : ] ) #NEWLINE# #UNINDENT# if ( version == 1 ) : #NEWLINE# #INDENT# return parse_data_file_v1 ( fp ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise Exception ( ( "Unrecognized data file format for file '%s'." % filepath ) ) #NEWLINE# #UNINDENT# #UNINDENT# except : #NEWLINE# #INDENT# raise