#NEWLINE# def readSettingsFromPySrcStr( self , theString ) : #NEWLINE# #INDENT# 'Return a dictionary of the settings in a Python src string.' #NEWLINE# globalsDict = { #NEWLINE# #INDENT# 'True' : ( 1 == 1 ) , #NEWLINE# 'False' : ( 0 == 1 ) , #NEWLINE# #UNINDENT# } #NEWLINE# newSettings = { #NEWLINE# #INDENT# 'self' : self , #NEWLINE# #UNINDENT# } #NEWLINE# exec ( ( theString + os . linesep ) , globalsDict , newSettings ) #NEWLINE# del newSettings [ 'self' ] #NEWLINE# module = types . ModuleType ( 'temp_settings_module' ) #NEWLINE# module . __dict__ . update ( newSettings ) #NEWLINE# return self . readSettingsFromModule ( module )