]> andersk Git - sql.git/blame - lib/python/mitsql/interface/__init__.py
implemented base interface
[sql.git] / lib / python / mitsql / interface / __init__.py
CommitLineData
e4fd5e1b
JP
1import mitsql
2config = mitsql.config.interface
3
4from MySQLdb import Connection as _connect
5from MySQLdb.cursors import DictCursor as _cursor
6
7def _connect(*argv, **kw):
8 return _connect(config.db_host, config.db_user, config.db_pass, config.db_name, cursorclass=_Cursor)
5cb62ba9 9
e4fd5e1b
JP
10from handler import Root as _root
11root = _root()
12
13from cheetah import load
14load(mitsql._base + '/www/templates')
15
16import cherrypy
17cherrypy.tree.mount(root, '/')
18cherrypy.config.update({'error_page.404': root.error._404,
19 'error_page.500': root.error._500,
20 'tools.staticdir.on': True,
21 'tools.staticdir.dir': mitsql._base + '/www/root'})
5cb62ba9
JP
22
23def map_uri():
24 print root.default()
25 #from cherrypy.lib.httpauth import parseAuthorization
26 #if not cherrypy.request.login:
27 # authorization = cherrypy.request.headers.get('Authorization', None)
28 # if authorization:
29 # cherrypy.request.login = parseAuthorization(authorization)
30
e4fd5e1b 31#cherrypy.tools.map_uri = cherrypy.Tool('on_start_resource', map_uri)
5cb62ba9 32#cherrypy.tools.map_uri = cherrypy.Tool('before_request_body', map_uri)
This page took 0.070944 seconds and 5 git commands to generate.