#NEWLINE# def loadAxiomSignaturesFromFile( self , axioms_file ) : #NEWLINE# #INDENT# '\n        Loads axiom signatures from a file `axioms_file`. This file should contain\n        axiom signatures on each line, but also can have commented lines (starting with a `#`)\n        or commented blocks (lines surrounded by lines of `"""`), as in python syntax.\n        ' #NEWLINE# axiom_signatures = [ ] #NEWLINE# line_number = 0 #NEWLINE# in_comment = False #NEWLINE# assert os . path . exists ( axioms_file ) , ( "unable to open file `%s'\n" % line_number ) #NEWLINE# with open ( axioms_file ) as f : #NEWLINE# #INDENT# for line in f : #NEWLINE# #INDENT# line_number += 1 #NEWLINE# if re . search ( '^"""' , line ) : #NEWLINE# #INDENT# in_comment = ( in_comment != True ) #NEWLINE# continue #NEWLINE# #UNINDENT# if ( ( not in_comment ) and ( not re . search ( '^#' , line ) ) and ( len ( line . strip ( ) ) > 0 ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# axiom_signatures . append ( FORANative . parseStringToJOV ( line . strip ( ) ) . getTuple ( ) ) #NEWLINE# #UNINDENT# except Exception as inst : #NEWLINE# #INDENT# logging . warn ( "unable to parse to JOV: `%s', %s:%s" , line . strip ( ) , axioms_file , line_number ) #NEWLINE# raise inst #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return axiom_signatures