'The script_name of the app at the given path, or None.
If path is None, cherrypy.request is used.'

def script_name(self, path=None):

    if (path is None):
        try:
            request = cherrypy.serving.request
            path = httputil.urljoin(request.script_name, request.path_info)
        except AttributeError:
            return None
    while True:
        if (path in self.apps):
            return path
        if (path == ''):
            return None
        path = path[:path.rfind('/')]
