From 65bd363a138b857d10c31141147ad4134c7adb7d Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Thu, 20 Jul 2017 09:13:51 +0400 Subject: [PATCH] =?UTF-8?q?webpyapp:=20r=C3=A9organiser=20les=20fichiers?= =?UTF-8?q?=20pour=20supporter=20des=20librairies=20locales?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/ulib/templates/webpyapp/.gitignore | 1 + .../templates/webpyapp/lib/{ => python}/__init__.py | 0 .../webpyapp/lib/{ => python}/flup/__init__.py | 0 .../lib/{ => python}/flup/client/__init__.py | 0 .../lib/{ => python}/flup/client/fcgi_app.py | 0 .../lib/{ => python}/flup/client/scgi_app.py | 0 .../lib/{ => python}/flup/server/__init__.py | 0 .../webpyapp/lib/{ => python}/flup/server/ajp.py | 0 .../lib/{ => python}/flup/server/ajp_base.py | 0 .../lib/{ => python}/flup/server/ajp_fork.py | 0 .../webpyapp/lib/{ => python}/flup/server/cgi.py | 0 .../webpyapp/lib/{ => python}/flup/server/fcgi.py | 0 .../lib/{ => python}/flup/server/fcgi_base.py | 0 .../lib/{ => python}/flup/server/fcgi_fork.py | 0 .../lib/{ => python}/flup/server/fcgi_single.py | 0 .../lib/{ => python}/flup/server/paste_factory.py | 0 .../lib/{ => python}/flup/server/preforkserver.py | 0 .../webpyapp/lib/{ => python}/flup/server/scgi.py | 0 .../lib/{ => python}/flup/server/scgi_base.py | 0 .../lib/{ => python}/flup/server/scgi_fork.py | 0 .../lib/{ => python}/flup/server/singleserver.py | 0 .../lib/{ => python}/flup/server/threadedserver.py | 0 .../lib/{ => python}/flup/server/threadpool.py | 0 lib/ulib/templates/webpyapp/server.py | 13 +++++++------ 24 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 lib/ulib/templates/webpyapp/.gitignore rename lib/ulib/templates/webpyapp/lib/{ => python}/__init__.py (100%) rename lib/ulib/templates/webpyapp/lib/{ => python}/flup/__init__.py (100%) rename lib/ulib/templates/webpyapp/lib/{ => python}/flup/client/__init__.py (100%) rename lib/ulib/templates/webpyapp/lib/{ => python}/flup/client/fcgi_app.py (100%) rename lib/ulib/templates/webpyapp/lib/{ => python}/flup/client/scgi_app.py (100%) rename lib/ulib/templates/webpyapp/lib/{ => python}/flup/server/__init__.py (100%) rename lib/ulib/templates/webpyapp/lib/{ => python}/flup/server/ajp.py (100%) rename lib/ulib/templates/webpyapp/lib/{ => python}/flup/server/ajp_base.py (100%) rename lib/ulib/templates/webpyapp/lib/{ => python}/flup/server/ajp_fork.py (100%) rename lib/ulib/templates/webpyapp/lib/{ => python}/flup/server/cgi.py (100%) rename lib/ulib/templates/webpyapp/lib/{ => python}/flup/server/fcgi.py (100%) rename lib/ulib/templates/webpyapp/lib/{ => python}/flup/server/fcgi_base.py (100%) rename lib/ulib/templates/webpyapp/lib/{ => python}/flup/server/fcgi_fork.py (100%) rename lib/ulib/templates/webpyapp/lib/{ => python}/flup/server/fcgi_single.py (100%) rename lib/ulib/templates/webpyapp/lib/{ => python}/flup/server/paste_factory.py (100%) rename lib/ulib/templates/webpyapp/lib/{ => python}/flup/server/preforkserver.py (100%) rename lib/ulib/templates/webpyapp/lib/{ => python}/flup/server/scgi.py (100%) rename lib/ulib/templates/webpyapp/lib/{ => python}/flup/server/scgi_base.py (100%) rename lib/ulib/templates/webpyapp/lib/{ => python}/flup/server/scgi_fork.py (100%) rename lib/ulib/templates/webpyapp/lib/{ => python}/flup/server/singleserver.py (100%) rename lib/ulib/templates/webpyapp/lib/{ => python}/flup/server/threadedserver.py (100%) rename lib/ulib/templates/webpyapp/lib/{ => python}/flup/server/threadpool.py (100%) diff --git a/lib/ulib/templates/webpyapp/.gitignore b/lib/ulib/templates/webpyapp/.gitignore new file mode 100644 index 0000000..539da74 --- /dev/null +++ b/lib/ulib/templates/webpyapp/.gitignore @@ -0,0 +1 @@ +*.py[co] diff --git a/lib/ulib/templates/webpyapp/lib/__init__.py b/lib/ulib/templates/webpyapp/lib/python/__init__.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/__init__.py rename to lib/ulib/templates/webpyapp/lib/python/__init__.py diff --git a/lib/ulib/templates/webpyapp/lib/flup/__init__.py b/lib/ulib/templates/webpyapp/lib/python/flup/__init__.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/flup/__init__.py rename to lib/ulib/templates/webpyapp/lib/python/flup/__init__.py diff --git a/lib/ulib/templates/webpyapp/lib/flup/client/__init__.py b/lib/ulib/templates/webpyapp/lib/python/flup/client/__init__.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/flup/client/__init__.py rename to lib/ulib/templates/webpyapp/lib/python/flup/client/__init__.py diff --git a/lib/ulib/templates/webpyapp/lib/flup/client/fcgi_app.py b/lib/ulib/templates/webpyapp/lib/python/flup/client/fcgi_app.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/flup/client/fcgi_app.py rename to lib/ulib/templates/webpyapp/lib/python/flup/client/fcgi_app.py diff --git a/lib/ulib/templates/webpyapp/lib/flup/client/scgi_app.py b/lib/ulib/templates/webpyapp/lib/python/flup/client/scgi_app.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/flup/client/scgi_app.py rename to lib/ulib/templates/webpyapp/lib/python/flup/client/scgi_app.py diff --git a/lib/ulib/templates/webpyapp/lib/flup/server/__init__.py b/lib/ulib/templates/webpyapp/lib/python/flup/server/__init__.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/flup/server/__init__.py rename to lib/ulib/templates/webpyapp/lib/python/flup/server/__init__.py diff --git a/lib/ulib/templates/webpyapp/lib/flup/server/ajp.py b/lib/ulib/templates/webpyapp/lib/python/flup/server/ajp.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/flup/server/ajp.py rename to lib/ulib/templates/webpyapp/lib/python/flup/server/ajp.py diff --git a/lib/ulib/templates/webpyapp/lib/flup/server/ajp_base.py b/lib/ulib/templates/webpyapp/lib/python/flup/server/ajp_base.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/flup/server/ajp_base.py rename to lib/ulib/templates/webpyapp/lib/python/flup/server/ajp_base.py diff --git a/lib/ulib/templates/webpyapp/lib/flup/server/ajp_fork.py b/lib/ulib/templates/webpyapp/lib/python/flup/server/ajp_fork.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/flup/server/ajp_fork.py rename to lib/ulib/templates/webpyapp/lib/python/flup/server/ajp_fork.py diff --git a/lib/ulib/templates/webpyapp/lib/flup/server/cgi.py b/lib/ulib/templates/webpyapp/lib/python/flup/server/cgi.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/flup/server/cgi.py rename to lib/ulib/templates/webpyapp/lib/python/flup/server/cgi.py diff --git a/lib/ulib/templates/webpyapp/lib/flup/server/fcgi.py b/lib/ulib/templates/webpyapp/lib/python/flup/server/fcgi.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/flup/server/fcgi.py rename to lib/ulib/templates/webpyapp/lib/python/flup/server/fcgi.py diff --git a/lib/ulib/templates/webpyapp/lib/flup/server/fcgi_base.py b/lib/ulib/templates/webpyapp/lib/python/flup/server/fcgi_base.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/flup/server/fcgi_base.py rename to lib/ulib/templates/webpyapp/lib/python/flup/server/fcgi_base.py diff --git a/lib/ulib/templates/webpyapp/lib/flup/server/fcgi_fork.py b/lib/ulib/templates/webpyapp/lib/python/flup/server/fcgi_fork.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/flup/server/fcgi_fork.py rename to lib/ulib/templates/webpyapp/lib/python/flup/server/fcgi_fork.py diff --git a/lib/ulib/templates/webpyapp/lib/flup/server/fcgi_single.py b/lib/ulib/templates/webpyapp/lib/python/flup/server/fcgi_single.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/flup/server/fcgi_single.py rename to lib/ulib/templates/webpyapp/lib/python/flup/server/fcgi_single.py diff --git a/lib/ulib/templates/webpyapp/lib/flup/server/paste_factory.py b/lib/ulib/templates/webpyapp/lib/python/flup/server/paste_factory.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/flup/server/paste_factory.py rename to lib/ulib/templates/webpyapp/lib/python/flup/server/paste_factory.py diff --git a/lib/ulib/templates/webpyapp/lib/flup/server/preforkserver.py b/lib/ulib/templates/webpyapp/lib/python/flup/server/preforkserver.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/flup/server/preforkserver.py rename to lib/ulib/templates/webpyapp/lib/python/flup/server/preforkserver.py diff --git a/lib/ulib/templates/webpyapp/lib/flup/server/scgi.py b/lib/ulib/templates/webpyapp/lib/python/flup/server/scgi.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/flup/server/scgi.py rename to lib/ulib/templates/webpyapp/lib/python/flup/server/scgi.py diff --git a/lib/ulib/templates/webpyapp/lib/flup/server/scgi_base.py b/lib/ulib/templates/webpyapp/lib/python/flup/server/scgi_base.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/flup/server/scgi_base.py rename to lib/ulib/templates/webpyapp/lib/python/flup/server/scgi_base.py diff --git a/lib/ulib/templates/webpyapp/lib/flup/server/scgi_fork.py b/lib/ulib/templates/webpyapp/lib/python/flup/server/scgi_fork.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/flup/server/scgi_fork.py rename to lib/ulib/templates/webpyapp/lib/python/flup/server/scgi_fork.py diff --git a/lib/ulib/templates/webpyapp/lib/flup/server/singleserver.py b/lib/ulib/templates/webpyapp/lib/python/flup/server/singleserver.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/flup/server/singleserver.py rename to lib/ulib/templates/webpyapp/lib/python/flup/server/singleserver.py diff --git a/lib/ulib/templates/webpyapp/lib/flup/server/threadedserver.py b/lib/ulib/templates/webpyapp/lib/python/flup/server/threadedserver.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/flup/server/threadedserver.py rename to lib/ulib/templates/webpyapp/lib/python/flup/server/threadedserver.py diff --git a/lib/ulib/templates/webpyapp/lib/flup/server/threadpool.py b/lib/ulib/templates/webpyapp/lib/python/flup/server/threadpool.py similarity index 100% rename from lib/ulib/templates/webpyapp/lib/flup/server/threadpool.py rename to lib/ulib/templates/webpyapp/lib/python/flup/server/threadpool.py diff --git a/lib/ulib/templates/webpyapp/server.py b/lib/ulib/templates/webpyapp/server.py index b661a11..efb2b4c 100755 --- a/lib/ulib/templates/webpyapp/server.py +++ b/lib/ulib/templates/webpyapp/server.py @@ -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:])