#NEWLINE# def _getPyDictionary( self , var ) : #NEWLINE# #INDENT# filterPrivate = False #NEWLINE# filterSpecial = True #NEWLINE# filterFunction = True #NEWLINE# filterBuiltIn = True #NEWLINE# names = dir ( var ) #NEWLINE# d = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( filterBuiltIn or filterFunction ) : #NEWLINE# #INDENT# for n in names : #NEWLINE# #INDENT# if filterSpecial : #NEWLINE# #INDENT# if ( n . startswith ( '__' ) and n . endswith ( '__' ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# if filterPrivate : #NEWLINE# #INDENT# if ( n . startswith ( '_' ) or n . endswith ( '__' ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# try : #NEWLINE# #INDENT# attr = getattr ( var , n ) #NEWLINE# if filterBuiltIn : #NEWLINE# #INDENT# if inspect . isbuiltin ( attr ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# if d : #NEWLINE# #INDENT# if ( inspect . isroutine ( attr ) or isinstance ( attr , MethodWrapperType ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except : #NEWLINE# #INDENT# strIO = StringIO . StringIO ( ) #NEWLINE# traceback . print_exc ( file = strIO ) #NEWLINE# attr = strIO . getvalue ( ) #NEWLINE# #UNINDENT# d [ n ] = attr #NEWLINE# #UNINDENT# #UNINDENT# return d