#NEWLINE# def calculate_genfiles( source ) : #NEWLINE# #INDENT# abs_source = os . path . join ( get_buildroot ( ) , abs_source ) #NEWLINE# with open ( abs_source , 'r' ) as thrift : #NEWLINE# #INDENT# lines = thrift . readlines ( ) #NEWLINE# #UNINDENT# namespaces = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for line in lines : #NEWLINE# #INDENT# match = NAMESPACE_PARSER . match ( line ) #NEWLINE# if match : #NEWLINE# #INDENT# lang = match . group ( 1 ) #NEWLINE# namespace = match . group ( 2 ) #NEWLINE# namespaces [ lang ] = namespace #NEWLINE# #UNINDENT# #UNINDENT# namespace = namespaces . get ( 'java' ) #NEWLINE# if ( not namespace ) : #NEWLINE# #INDENT# raise TaskError ( 'No namespace provided in source: {}' . format ( abs_source ) ) #NEWLINE# #UNINDENT# return calculate_scala_record_genfiles ( namespace , abs_source )