webpyapp: réorganiser les fichiers pour supporter des librairies locales
This commit is contained in:
parent
0b39b2324b
commit
65bd363a13
|
@ -0,0 +1 @@
|
||||||
|
*.py[co]
|
|
@ -3,6 +3,12 @@
|
||||||
|
|
||||||
__all__ = ('Server',)
|
__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
|
from ulib.web import web, Application, Page, defaults
|
||||||
|
|
||||||
class Server(Application):
|
class Server(Application):
|
||||||
|
@ -17,9 +23,4 @@ class index(Page):
|
||||||
PREFIX = r'/'
|
PREFIX = r'/'
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import sys
|
Server(SCRIPTDIR).run(sys.argv[1:])
|
||||||
from os import path
|
|
||||||
|
|
||||||
basedir = path.abspath(path.split(__file__)[0])
|
|
||||||
sys.path.append(path.join(basedir, 'lib'))
|
|
||||||
Server(basedir).run(sys.argv[1:])
|
|
||||||
|
|
Loading…
Reference in New Issue