allow to specify repositories root
yed_ authored 7 years ago
Jiri Suchan committed 7 years ago
84 | 84 |
--env KLAUS_REPOS="/path/to/repo1 /path/to/repo2 ..." \
|
85 | 85 |
klaus.contrib.wsgi
|
86 | 86 |
|
87 | |
See also `deploymeny section in the wiki <https://github.com/jonashaag/klaus/wiki#deployment>`_.
|
|
87 |
See also `deployment section in the wiki <https://github.com/jonashaag/klaus/wiki#deployment>`_.
|
88 | 88 |
|
89 | 89 |
.. _wsgiref: http://docs.python.org/library/wsgiref.html
|
0 | 0 |
import os
|
1 | 1 |
import time
|
2 | 2 |
import threading
|
|
3 |
import warnings
|
|
4 |
|
3 | 5 |
from klaus import make_app
|
4 | |
|
5 | 6 |
|
6 | 7 |
# Shared state between poller and application wrapper
|
7 | 8 |
class _:
|
|
48 | 49 |
return app
|
49 | 50 |
|
50 | 51 |
|
|
52 |
if 'KLAUS_REPOS' in os.environ:
|
|
53 |
warnings.warn("use KLAUS_REPOS_ROOT instead of KLAUS_REPOS for the autoreloader apps", DeprecationWarning)
|
|
54 |
|
51 | 55 |
if 'KLAUS_HTDIGEST_FILE' in os.environ:
|
52 | 56 |
with open(os.environ['KLAUS_HTDIGEST_FILE']) as file:
|
53 | |
application = make_app(
|
54 | |
os.environ['KLAUS_REPOS'],
|
|
57 |
application = make_autoreloading_app(
|
|
58 |
os.environ.get('KLAUS_REPOS_ROOT') or os.environ['KLAUS_REPOS'],
|
55 | 59 |
os.environ['KLAUS_SITE_NAME'],
|
56 | 60 |
os.environ.get('KLAUS_USE_SMARTHTTP'),
|
57 | 61 |
file,
|
58 | 62 |
)
|
59 | 63 |
else:
|
60 | 64 |
application = make_autoreloading_app(
|
61 | |
os.environ['KLAUS_REPOS'],
|
|
65 |
os.environ.get('KLAUS_REPOS_ROOT') or os.environ['KLAUS_REPOS'],
|
62 | 66 |
os.environ['KLAUS_SITE_NAME'],
|
63 | 67 |
os.environ.get('KLAUS_USE_SMARTHTTP'),
|
64 | |
None,
|
65 | 68 |
)
|