(mcs, name, bases, cls_dict)
return super(ControllerMetaclass, mcs).__new__(mcs, name, bases,
                                                       cls_dict)
Adds version function dictionary to the class.
Adds version function dictionary to the class.
Adds version function dictionary to the class .
def __new__(mcs, name, bases, cls_dict):
        """Adds version function dictionary to the class."""

        versioned_methods = None

        for base in bases:
            if base.__name__ == "Controller":
                # NOTE(cyeoh): This resets the VER_METHOD_ATTR attribute
                # between API controller class creations. This allows us
                # to use a class decorator on the API methods that doesn't
                # require naming explicitly what method is being versioned as
                # it can be implicit based on the method decorated. It is a bit
                # ugly.
                if VER_METHOD_ATTR in base.__dict__:
                    versioned_methods = getattr(base, VER_METHOD_ATTR)
                    delattr(base, VER_METHOD_ATTR)

        if versioned_methods:
            cls_dict[VER_METHOD_ATTR] = versioned_methods

        return super(ControllerMetaclass, mcs).__new__(mcs, name, bases,
                                                       cls_dict)
def __new__ ( mcs , name , bases , cls_dict ) : versioned_methods = None for base in bases : if base . __name__ == "Controller" : # NOTE(cyeoh): This resets the VER_METHOD_ATTR attribute # between API controller class creations. This allows us # to use a class decorator on the API methods that doesn't # require naming explicitly what method is being versioned as # it can be implicit based on the method decorated. It is a bit # ugly. if VER_METHOD_ATTR in base . __dict__ : versioned_methods = getattr ( base , VER_METHOD_ATTR ) delattr ( base , VER_METHOD_ATTR ) if versioned_methods : cls_dict [ VER_METHOD_ATTR ] = versioned_methods return super ( ControllerMetaclass , mcs ) . __new__ ( mcs , name , bases , cls_dict )