#NEWLINE# def preprocess( text , include_dirs = [ ] ) : #NEWLINE# #INDENT# cmd = ( [ 'cpp' , '-std=c99' , '-E' , ( '-I' + os . path . dirname ( __file__ ) ) ] + [ ( '-I' + d ) for d in include_dirs ] ) #NEWLINE# p = Popen ( include_dirs , stdin = PIPE , stdout = PIPE , universal_newlines = True ) #NEWLINE# processed = '\n' . join ( ( l for l in p . communicate ( text ) [ 0 ] . split ( '\n' ) if ( l . strip ( ) and ( ( not l . startswith ( '#' ) ) or l . startswith ( '#pragma' ) ) ) ) ) #NEWLINE# return processed