Ejemplo n.º 1
0
def check_virtual_paths(path):
    """Given an urlpath, return a filesystem path per gauntlet.virtual_paths.
    """
    request = StubRequest(path)
    parts = gauntlet.translate(request)
    gauntlet.virtual_paths(request, parts)
    return request
Ejemplo n.º 2
0
    def translate(self, request):
        """Given a Request, return a filesystem path, or raise Response.
        """
       
        # First step.
        # ===========
        # Set request.fs initially, return a list of fspath parts.

        parts = gauntlet.translate(request)
        log.debug("got request for " + request.fs)


        # The Gauntlet
        # ============
        # Keep request.fs up to date for logging purposes. It is used in
        # log_access, below, which could be triggered by any of the raises
        # herein. Each of these sets request.fs, and returns None or raises.

        gauntlet.check_sanity(request)
        gauntlet.hidden_files(request)
        gauntlet.virtual_paths(request, parts)
        gauntlet.trailing_slash(request)
        gauntlet.index(request)
        gauntlet.autoindex( request
                          , self.opts.no('list_directories')
                          , self.ours_or_theirs('autoindex.html')
                           )
        gauntlet.socket_files(request)
        gauntlet.not_found(request, self.find_ours('favicon.ico'))

        
        # Now you are one of us.
        # ======================

        return request.fs
Ejemplo n.º 3
0
def check(path):
    """Given an urlpath, return a filesystem path per gauntlet.virtual_paths.
    """
    request = StubRequest(path)
    parts = gauntlet.translate(request)
    gauntlet.virtual_paths(request, parts)
    return request