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:])