'Parse dictionary created by routes library.'

def get_action_args(self, request_environment):

    if hasattr(self.controller, 'get_action_args'):
        return self.controller.get_action_args(request_environment)
    try:
        args = request_environment['wsgiorg.routing_args'][1].copy()
    except (KeyError, IndexError, AttributeError):
        return {}
    try:
        del args['controller']
    except KeyError:
        pass
    try:
        del args['format']
    except KeyError:
        pass
    return args
