webpyapp: réorganiser les fichiers pour supporter des librairies locales

This commit is contained in:
Jephté Clain 2017-07-20 09:13:51 +04:00
parent 0b39b2324b
commit 65bd363a13
24 changed files with 8 additions and 6 deletions

View File

@ -0,0 +1 @@
*.py[co]

View File

@ -3,6 +3,12 @@
__all__ = ('Server',)
import sys, os
from os import path
SCRIPTDIR = path.abspath(path.split(__file__)[0])
sys.path.insert(0, path.join(SCRIPTDIR, 'lib/python'))
from ulib.web import web, Application, Page, defaults
class Server(Application):
@ -17,9 +23,4 @@ class index(Page):
PREFIX = r'/'
if __name__ == '__main__':
import sys
from os import path
basedir = path.abspath(path.split(__file__)[0])
sys.path.append(path.join(basedir, 'lib'))
Server(basedir).run(sys.argv[1:])
Server(SCRIPTDIR).run(sys.argv[1:])