예제 #1
0
class HttpDbDispatcher(object):
    """
    this is our custom dispatcher which strips out the database name (first
    url part) and pass the rest of the url to the default dispatcher
    
    """
    dispatcher = Dispatcher()

    def __call__(self, path_info):
        list = path_info.strip('/').split('/', 1)

        #handle root url
        if len(list) < 2:
            self.dispatcher("/")
            return

        DBNAME = list[0]
        self.dispatcher(list[1])
예제 #2
0
파일: mdx.py 프로젝트: skanct/pyFF
 def __init__(self, prefixes, enc, next_dispatcher=Dispatcher()):
     self.prefixes = prefixes
     self.enc = enc
     self.next_dispatcher = next_dispatcher