yhttp 9.0.2__tar.gz → 9.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {yhttp-9.0.2 → yhttp-9.2.0}/PKG-INFO +2 -2
- {yhttp-9.0.2 → yhttp-9.2.0}/setup.py +1 -1
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_applicationcli.py +6 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp/core/application.py +3 -3
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp/core/cli.py +12 -3
- yhttp-9.2.0/yhttp/core/version.py +1 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp.egg-info/PKG-INFO +2 -2
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp.egg-info/requires.txt +1 -1
- yhttp-9.0.2/yhttp/core/version.py +0 -1
- {yhttp-9.0.2 → yhttp-9.2.0}/LICENSE +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/README.md +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/setup.cfg +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_application.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_builtincli_serve.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_builtincli_version.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_builtincli_yhttp_version.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_cookie.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_cookieset.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_extension.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_form.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_form_json.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_form_multipart.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_form_urlencoded.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_fswatcher.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_guard.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_guard_body.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_guard_contenttypes.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_guard_query.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_headerset.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_jsonencoding.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_locale.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_middleware.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_multidict.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_multipart.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_querystring.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_request.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_responseheaders.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_rewrite.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_rewritecli.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_routing.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_static.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_statuses.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/tests/test_statushandler.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp/core/__init__.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp/core/contenttypes.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp/core/cookieset.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp/core/fswatcher.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp/core/guard.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp/core/headerset.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp/core/main.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp/core/multidict.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp/core/multipart.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp/core/request.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp/core/response.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp/core/rewrite.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp/core/static.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp/core/statuses.py +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp.egg-info/SOURCES.txt +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp.egg-info/dependency_links.txt +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp.egg-info/entry_points.txt +0 -0
- {yhttp-9.0.2 → yhttp-9.2.0}/yhttp.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: yhttp
|
|
3
|
-
Version: 9.0
|
|
3
|
+
Version: 9.2.0
|
|
4
4
|
Summary: A very micro http framework.
|
|
5
5
|
Home-page: http://github.com/yhttp/yhttp
|
|
6
6
|
Author: Vahid Mardani
|
|
@@ -22,7 +22,7 @@ Classifier: Topic :: Software Development :: Libraries
|
|
|
22
22
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
24
|
License-File: LICENSE
|
|
25
|
-
Requires-Dist:
|
|
25
|
+
Requires-Dist: snam>=1.0.2
|
|
26
26
|
Requires-Dist: easycli<2,>=1.10.1
|
|
27
27
|
Requires-Dist: ujson
|
|
28
28
|
Requires-Dist: inotify-simple
|
|
@@ -64,9 +64,15 @@ def test_applicationcli(mktmpfile):
|
|
|
64
64
|
assert stdout == 'foo\n.\n'
|
|
65
65
|
|
|
66
66
|
when(f'--configuration-file {configfile} foo')
|
|
67
|
+
assert stderr == ''
|
|
67
68
|
assert status == 73
|
|
68
69
|
assert stdout == 'bar\n.\n'
|
|
69
70
|
|
|
71
|
+
when(f'--verbose --configuration-file {configfile} foo')
|
|
72
|
+
assert stderr == ''
|
|
73
|
+
assert status == 73
|
|
74
|
+
assert stdout == f'loading config file: {configfile}\nbar\n.\n'
|
|
75
|
+
|
|
70
76
|
when('--directory /tmp foo')
|
|
71
77
|
assert status == 0
|
|
72
78
|
assert stdout == 'foo\n/tmp\n'
|
|
@@ -4,7 +4,7 @@ import functools
|
|
|
4
4
|
import re
|
|
5
5
|
import types
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import snam
|
|
8
8
|
|
|
9
9
|
from . import statuses, static
|
|
10
10
|
from .request import Request
|
|
@@ -39,7 +39,7 @@ class BaseApplication:
|
|
|
39
39
|
debug: true
|
|
40
40
|
'''
|
|
41
41
|
|
|
42
|
-
#: Instance of :class:`
|
|
42
|
+
#: Instance of :class:`snam.Meld` as the global configuration instance.
|
|
43
43
|
settings = None
|
|
44
44
|
|
|
45
45
|
#: A list of :class:`easycli.Argument` or :class:`easycli.SubCommand`.
|
|
@@ -62,7 +62,7 @@ class BaseApplication:
|
|
|
62
62
|
self.name = name
|
|
63
63
|
self.events = {}
|
|
64
64
|
self.cliarguments = []
|
|
65
|
-
self.settings =
|
|
65
|
+
self.settings = snam.loads(self._builtinsettings)
|
|
66
66
|
self.request_middlewares = []
|
|
67
67
|
|
|
68
68
|
def when(self, func):
|
|
@@ -186,6 +186,12 @@ class Main(Root):
|
|
|
186
186
|
help='Set a configutation entry: -O foo.bar.baz=\'qux\'. this '
|
|
187
187
|
'argument can passed multiple times.'
|
|
188
188
|
),
|
|
189
|
+
Argument(
|
|
190
|
+
'-v', '--verbose',
|
|
191
|
+
action='store_true',
|
|
192
|
+
default=False,
|
|
193
|
+
help='Verbose mode'
|
|
194
|
+
),
|
|
189
195
|
Serve,
|
|
190
196
|
]
|
|
191
197
|
|
|
@@ -207,7 +213,9 @@ class Main(Root):
|
|
|
207
213
|
os.chdir(args.directory)
|
|
208
214
|
|
|
209
215
|
if args.configurationfile:
|
|
210
|
-
|
|
216
|
+
if args.verbose:
|
|
217
|
+
print(f'loading config file: {args.configurationfile}')
|
|
218
|
+
self.application.settings <<= args.configurationfile
|
|
211
219
|
|
|
212
220
|
else: # pragma: no cover
|
|
213
221
|
# try to find user specific config file
|
|
@@ -218,8 +226,9 @@ class Main(Root):
|
|
|
218
226
|
filename = f'/home/{user}/.config/{appname}/{appname}.yml'
|
|
219
227
|
|
|
220
228
|
if os.path.exists(filename):
|
|
221
|
-
|
|
222
|
-
|
|
229
|
+
if args.verbose:
|
|
230
|
+
print(f'loading config file: {filename}')
|
|
231
|
+
self.application.settings <<= filename
|
|
223
232
|
|
|
224
233
|
for o in args.option:
|
|
225
234
|
try:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '9.2.0'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: yhttp
|
|
3
|
-
Version: 9.0
|
|
3
|
+
Version: 9.2.0
|
|
4
4
|
Summary: A very micro http framework.
|
|
5
5
|
Home-page: http://github.com/yhttp/yhttp
|
|
6
6
|
Author: Vahid Mardani
|
|
@@ -22,7 +22,7 @@ Classifier: Topic :: Software Development :: Libraries
|
|
|
22
22
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
24
|
License-File: LICENSE
|
|
25
|
-
Requires-Dist:
|
|
25
|
+
Requires-Dist: snam>=1.0.2
|
|
26
26
|
Requires-Dist: easycli<2,>=1.10.1
|
|
27
27
|
Requires-Dist: ujson
|
|
28
28
|
Requires-Dist: inotify-simple
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '9.0.2'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|