Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

what the code "return cls()" meaning

I am a newcomer of openstack and python. When I read the code in file nova-2011.3\nova\api\

I found these lines

class APIRouter(base_wsgi.Router): """ Routes requests on the OpenStack API to the appropriate controller and method. """

def factory(cls, global_config, **local_config):
    """Simple paste factory, :class:`nova.wsgi.Router` doesn't have one"""
    return cls()

My question is: what the code "return cls()" means in the factory() class method? where to find the factory() method body?

Please help me, thx.