#NEWLINE# def if_file_get_content( value ) : #NEWLINE# #INDENT# '\n        if value is the path to a local file, read the content and return it\n        otherwise just return value\n    ' #NEWLINE# file_path = path . abspath ( value ) #NEWLINE# if path . isfile ( file_path ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# f = open ( file_path , 'rU' ) #NEWLINE# #UNINDENT# except IOError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# content = f . read ( ) #NEWLINE# f . close ( ) #NEWLINE# return content #NEWLINE# #UNINDENT# #UNINDENT# if ( sys . platform == 'win32' ) : #NEWLINE# #INDENT# return value . decode ( 'windows-1252' ) . encode ( 'UTF-8' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return recode_input ( value )