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):
|
|
|
|
Application.__init__(self, basedir, templatedir, host, port, debug)
|
|
|
|
|
|
|
|
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:])
|