Пример #1
0
def __initHooks():
    from web.protocol import HandleConnection

    HandleConnection.addFunction(doUserDirPre, "*", 0)
    import requestHandler.requestHandler as rh

    rh.EndSession.addFunction(doUserDirPost)
Пример #2
0
def __initHooks():
    import SkunkWeb.constants as skc
    import Handler
    from web.protocol import HandleConnection
    from requestHandler.protocol import RequestFailed
    jobGlob=skc.TEMPLATING_JOB+'*'
    HandleConnection.addFunction(Handler.requestHandler, jobGlob)
    HandleConnection.addFunction(Handler.plainHandler, jobGlob)
    HandleConnection.addFunction(Handler.fourOhFourHandler, jobGlob)
    RequestFailed.addFunction(_formatException, jobGlob)
Пример #3
0
def __initHooks():
    import SkunkWeb.constants as skc
    import Handler
    from web.protocol import HandleConnection
    from requestHandler.protocol import RequestFailed
    jobGlob=skc.TEMPLATING_JOB+'*'
    HandleConnection.addFunction(Handler.requestHandler, jobGlob)
    HandleConnection.addFunction(Handler.plainHandler, jobGlob)
    HandleConnection.addFunction(Handler.fourOhFourHandler, jobGlob)
    RequestFailed.addFunction(_formatException, jobGlob)
Пример #4
0
def __initHooks():
    import SkunkWeb.constants as skc
    #TEMPORARILY HARD-CODED in SkunkWeb.constants.py -- FIX NE ***
    #rc.TEMPLATING_JOB= rc.WEB_JOB + rc.AE_COMPONENT_JOB + '/templating/'
    import Handler
    from web.protocol import HandleConnection
    from aecgi import RequestFailed
    jobGlob=skc.TEMPLATING_JOB+'*'
    HandleConnection.addFunction(Handler.requestHandler, jobGlob)
    HandleConnection.addFunction(Handler.plainHandler, jobGlob)
    HandleConnection.addFunction(Handler.fourOhFourHandler, jobGlob)
    RequestFailed.addFunction(_formatException, jobGlob)
Пример #5
0
                except PreemptiveResponse:
                    # not a problem, raise it
                    raise
                except Response, res:
                    res(connection)
                    return connection.response()
                except:
                    # OK, something bad.  This should be a server error.
                    return _handleException(connection)
                else:
                    if res:
                        if isinstance(res, basestring):
                            connection.write(res)
                        elif callable(res):
                            res(connection)
                        else:
                            # an iterable, hopefully
                            for thing in res:
                                connection.write(thing)
                        return connection.response()
                
                    
glob='%s*' % WEB_JOB
# go *before* the templating handlers
HandleConnection.addFunction(controllerHandler, glob, 0)


                    
                
                
Пример #6
0
                # some defaults
                connection.setStatus(200)
                connection.setContentType('text/html')
                try:
                    res = meth(**data)
                except PreemptiveResponse:
                    # not a problem, raise it
                    raise
                except Response:
                    res(connection)
                    return connection.response()
                except:
                    # OK, something bad.  This should be a server error.
                    return _handleException(connection)
                else:
                    if res:
                        if isinstance(res, basestring):
                            connection.write(res)
                        elif callable(res):
                            res(connection)
                        else:
                            # an iterable, hopefully
                            for thing in res:
                                connection.write(thing)
                        return connection.response()


glob = '%s*' % WEB_JOB
# go *before* the templating handlers
HandleConnection.addFunction(controllerHandler, glob, 0)
Пример #7
0
def __initHooks():
    from web.protocol import HandleConnection
    HandleConnection.addFunction(doUserDirPre, '*', 0)
    import requestHandler.requestHandler as rh
    rh.EndSession.addFunction(doUserDirPost)