2017-07-18 07:56:15 +04:00
|
|
|
#!/usr/bin/env python2
|
2017-07-17 21:59:20 +04:00
|
|
|
# -*- coding: utf-8 mode: python -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
|
|
|
|
|
|
|
__all__ = ('Server',)
|
|
|
|
|
|
|
|
from ulib.web import web, Application, Page, defaults
|
|
|
|
|
|
|
|
class Server(Application):
|
|
|
|
def __init__(self, basedir=None, templatedir=None, host=None, port=None, debug=None):
|
2017-07-20 00:16:02 +04:00
|
|
|
super(Server, self).__init__(basedir, templatedir, host, port, debug)
|
2017-07-17 21:59:20 +04:00
|
|
|
|
2017-07-19 23:45:26 +04:00
|
|
|
def _new_session(self):
|
|
|
|
pass # décommenter la ligne suivante pour activer les sessions
|
|
|
|
#return web.session.DiskStore('sessions'), {}
|
|
|
|
|
2017-07-17 21:59:20 +04:00
|
|
|
class index(Page):
|
|
|
|
PREFIX = r'/'
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
import sys
|
|
|
|
from os import path
|
|
|
|
|
|
|
|
basedir = path.abspath(path.split(__file__)[0])
|
2017-07-18 09:32:17 +04:00
|
|
|
sys.path.append(path.join(basedir, 'lib'))
|
2017-07-17 21:59:20 +04:00
|
|
|
Server(basedir).run(sys.argv[1:])
|