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

« back to all changes in this revision

Viewing changes to www/dispatch/__init__.py

  • Committer: mattgiuca
  • Date: 2008-01-09 21:33:56 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:144
Trunk, and all subdirectories with Python files:
    Added to svn:ignore all *.pyc *.pyo, to avoid compiled files
    showing up in svn st / diff / commit lists.
    Added to svn:ignore trampoline/trampoline.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
            # TODO: Nicer 404 message?
60
60
            req.throw_error(Request.HTTP_NOT_FOUND)
61
61
 
62
 
    # Special handling for public mode - just call public app and get out
63
 
    # NOTE: This will not behave correctly if the public app uses
64
 
    # write_html_head_foot, but "serve" does not.
65
 
    if req.publicmode:
66
 
        app = conf.apps.app_url[conf.apps.public_app]
67
 
        apps.call_app(app.dir, req)
68
 
        return req.OK
69
 
 
70
62
    # app is the App object for the chosen app
71
63
    if req.app is None:
72
 
        app = conf.apps.app_url[conf.apps.default_app]
 
64
        app = conf.apps.app_url[conf.default_app]
73
65
    else:
74
66
        app = conf.apps.app_url[req.app]
75
67
 
82
74
        logged_in = True
83
75
 
84
76
    if logged_in:
85
 
        # Keep the user's session alive by writing to the session object.
86
 
        req.get_session().save()
87
77
        # If user did not specify an app, HTTP redirect to default app and
88
78
        # exit.
89
79
        if req.app is None:
90
 
            req.throw_redirect(util.make_path(conf.apps.default_app))
 
80
            req.throw_redirect(util.make_path(conf.default_app))
91
81
 
92
82
        # Set the default title to the app's tab name, if any. Otherwise URL
93
83
        # name.