File: __init__.py

package info (click to toggle)
quixote1 1.2-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 1,016 kB
  • ctags: 1,114
  • sloc: python: 5,334; ansic: 1,297; makefile: 75; sh: 43
file content (35 lines) | stat: -rw-r--r-- 1,233 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""quixote
$HeadURL: svn+ssh://svn/repos/trunk/quixote/__init__.py $
$Id: __init__.py 25278 2004-10-06 15:49:42Z nascheme $

A highly Pythonic web application framework.
"""

__revision__ = "$Id: __init__.py 25278 2004-10-06 15:49:42Z nascheme $"

__version__ = "1.2"

__all__ = ['Publisher',
           'get_publisher', 'get_request', 'get_session', 'get_user',
           'get_path', 'enable_ptl', 'redirect']


# These are frequently needed by Quixote applications, so make them easy
# to get at.
from quixote.publish import Publisher, \
     get_publisher, get_request, get_path, redirect, \
     get_session, get_session_manager, get_user

# Can't think of anywhere better to put this, so here it is.
def enable_ptl():
    """
    Installs the import hooks needed to import PTL modules.  This must
    be done explicitly because not all Quixote applications need to use
    PTL, and import hooks are deep magic that can cause all sorts of
    mischief and deeply confuse innocent bystanders.  Thus, we avoid
    invoking them behind the programmer's back.  One known problem is
    that, if you use ZODB, you must import ZODB before calling this
    function.
    """
    from quixote import ptl_import
    ptl_import.install()