~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/dispatch_handler.py

  • Committer: mattgiuca
  • Date: 2008-01-09 03:42:54 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:135
dispatch_handler: Fixed exception handler, no longer catches ALL keyerrors in
the entire application suite, only the one intended.
dispatch/html.py: Fixed href links in the tabs at the top - now link to the
URL name of the app, not the dir name (which would be broken if an app had a
different URL name to its dir name).

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
 
42
42
    try:
43
43
        handlerpath = req.get_options()['ivle.handlerpath']
44
 
        if handlerpath not in sys.path:
45
 
            sys.path.append(handlerpath)
46
 
        import dispatch
47
 
        import conf
48
 
        return dispatch.handler(req)
49
44
    except KeyError:
50
45
        # Note: "Internal Server Error" if "ivle.handlerpath" is not set
51
46
        # (this is valid as it reflects an error in the Apache config
52
47
        # But give useful feedback in debug mode
53
48
        raise Exception("Missing configuration option 'ivle.handlerpath'")
 
49
 
 
50
    if handlerpath not in sys.path:
 
51
        sys.path.append(handlerpath)
 
52
    import dispatch
 
53
    import conf
 
54
    return dispatch.handler(req)