def get_class_meta(klass):
    """
    Returns a C{dict} containing meta data based on the supplied class, useful
    for class aliasing.

    @rtype: C{dict}
    @since: 0.5
    """
    if not isinstance(klass, python.class_types) or klass is object:
        raise TypeError('klass must be a class object, got %r' % type(klass))

    meta = {
        'static_attrs': None,
        'exclude_attrs': None,
        'readonly_attrs': None,
        'proxy_attrs': None,
        'amf3': None,
        'dynamic': None,
        'alias': None,
        'external': None,
        'synonym_attrs': None
    }

    if not hasattr(klass, '__amf__'):
        return meta

    a = klass.__amf__

    if type(a) is dict:
        in_func = lambda x: x in a
        get_func = a.__getitem__
    else:
        in_func = lambda x: hasattr(a, x)
        get_func = lambda x: getattr(a, x)

    for prop in ['alias', 'amf3', 'dynamic', 'external']:
        if in_func(prop):
            meta[prop] = get_func(prop)

    for prop in ['static', 'exclude', 'readonly', 'proxy', 'synonym']:
        if in_func(prop):
            meta[prop + '_attrs'] = get_func(prop)

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

    @rtype: C{dict}
    @since: 0.5