#NEWLINE# def get_class_meta( klass ) : #NEWLINE# #INDENT# '\n    Returns a C{dict} containing meta data based on the supplied class, useful\n    for class aliasing.\n\n    @rtype: C{dict}\n    @since: 0.5\n    ' #NEWLINE# if ( ( not isinstance ( klass , python . class_types ) ) or ( klass is object ) ) : #NEWLINE# #INDENT# raise TypeError ( ( 'klass must be a class object, got %r' % type ( klass ) ) ) #NEWLINE# #UNINDENT# meta = { #NEWLINE# #INDENT# 'static_attrs' : None , #NEWLINE# 'exclude_attrs' : None , #NEWLINE# 'readonly_attrs' : None , #NEWLINE# 'proxy_attrs' : None , #NEWLINE# 'amf3' : None , #NEWLINE# 'dynamic' : None , #NEWLINE# 'alias' : None , #NEWLINE# 'external' : None , #NEWLINE# 'synonym_attrs' : None , #NEWLINE# #UNINDENT# } #NEWLINE# if ( not hasattr ( klass , '__amf__' ) ) : #NEWLINE# #INDENT# return meta #NEWLINE# #UNINDENT# a = klass . __amf__ #NEWLINE# if ( type ( a ) is dict ) : #NEWLINE# #INDENT# in_func = ( lambda x : ( x in a ) ) #NEWLINE# get_func = a . __getitem__ #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# in_func = ( lambda x : hasattr ( a , x ) ) #NEWLINE# get_func = ( lambda x : getattr ( a , x ) ) #NEWLINE# #UNINDENT# for prop in [ 'alias' , 'amf3' , 'dynamic' , 'external' ] : #NEWLINE# #INDENT# if in_func ( prop ) : #NEWLINE# #INDENT# meta [ prop ] = get_func ( prop ) #NEWLINE# #UNINDENT# #UNINDENT# for prop in [ 'static' , 'exclude' , 'readonly' , 'proxy' , 'synonym' ] : #NEWLINE# #INDENT# if in_func ( prop ) : #NEWLINE# #INDENT# meta [ ( prop + '_attrs' ) ] = get_func ( prop ) #NEWLINE# #UNINDENT# #UNINDENT# return meta