omserv 0.0.0.dev193__py3-none-any.whl → 0.0.0.dev194__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- omserv/nginx/__init__.py +4 -0
- {omserv-0.0.0.dev193.dist-info → omserv-0.0.0.dev194.dist-info}/METADATA +2 -2
- {omserv-0.0.0.dev193.dist-info → omserv-0.0.0.dev194.dist-info}/RECORD +7 -8
- omserv/nginx/configs.py +0 -76
- {omserv-0.0.0.dev193.dist-info → omserv-0.0.0.dev194.dist-info}/LICENSE +0 -0
- {omserv-0.0.0.dev193.dist-info → omserv-0.0.0.dev194.dist-info}/WHEEL +0 -0
- {omserv-0.0.0.dev193.dist-info → omserv-0.0.0.dev194.dist-info}/entry_points.txt +0 -0
- {omserv-0.0.0.dev193.dist-info → omserv-0.0.0.dev194.dist-info}/top_level.txt +0 -0
omserv/nginx/__init__.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: omserv
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev194
|
4
4
|
Summary: omserv
|
5
5
|
Author: wrmsr
|
6
6
|
License: BSD-3-Clause
|
@@ -12,7 +12,7 @@ Classifier: Operating System :: OS Independent
|
|
12
12
|
Classifier: Operating System :: POSIX
|
13
13
|
Requires-Python: >=3.12
|
14
14
|
License-File: LICENSE
|
15
|
-
Requires-Dist: omlish==0.0.0.
|
15
|
+
Requires-Dist: omlish==0.0.0.dev194
|
16
16
|
Provides-Extra: all
|
17
17
|
Requires-Dist: h11~=0.14; extra == "all"
|
18
18
|
Requires-Dist: h2~=4.1; extra == "all"
|
@@ -9,9 +9,8 @@ omserv/apps/routes.py,sha256=shcN8qCSF2YoKal7nk-lemCAK3RX8MuHgNHhq_CTnh0,3762
|
|
9
9
|
omserv/apps/sessions.py,sha256=glruQSbOSbCYLPp6nDRNSHCyp5hj4oiOPhh3R0F9BTM,1537
|
10
10
|
omserv/apps/templates.py,sha256=PBRZHIF9UbnFnq-4EC6RmPeRkeH8lCBbpJkSdseHs6A,2125
|
11
11
|
omserv/daemon/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
12
|
-
omserv/nginx/__init__.py,sha256=
|
12
|
+
omserv/nginx/__init__.py,sha256=2d63LCGFA2qS7gdl2nCvNPmQWXNICu19wZIihQJPHCs,48
|
13
13
|
omserv/nginx/build.py,sha256=2LzI5eM3U2V0CbUHEOHx4zwnMl5CU2lhu-odPrI7idU,3203
|
14
|
-
omserv/nginx/configs.py,sha256=cOCz3_QxkZfS5j_zQBQNeDWdMjv8CWGB8YqEZ2FL7tI,2106
|
15
14
|
omserv/nginx/logs.py,sha256=cODPsG1j3EQiXbb9SR20NpB9MjGdWN0ArFZ-TA9xf-c,1840
|
16
15
|
omserv/nginx/stubstatus.py,sha256=_VnXZdXxSA7jIelYSwJLf9mOnt_UOvpWghAPWtlWSLw,1857
|
17
16
|
omserv/nginx/patches/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -48,9 +47,9 @@ omserv/server/streams/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
|
|
48
47
|
omserv/server/streams/httpstream.py,sha256=0DeiAPLGbEGNa0fHTs8lUpi_CFZs4M5_QB-TiS8mobQ,8015
|
49
48
|
omserv/server/streams/utils.py,sha256=aMOrqWIg_Hht5W4kLg3y7oR5AEkVvMrZhyjzo6U5owE,1527
|
50
49
|
omserv/server/streams/wsstream.py,sha256=3Vyzox7dCE1tDSXjb6xBubWo41ZF9d38Hrsrlj6h1J8,15482
|
51
|
-
omserv-0.0.0.
|
52
|
-
omserv-0.0.0.
|
53
|
-
omserv-0.0.0.
|
54
|
-
omserv-0.0.0.
|
55
|
-
omserv-0.0.0.
|
56
|
-
omserv-0.0.0.
|
50
|
+
omserv-0.0.0.dev194.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
51
|
+
omserv-0.0.0.dev194.dist-info/METADATA,sha256=_pFc5gvxibVwJ6RuNS9gXXejRZIBl-6PmoH5vLO7G9o,983
|
52
|
+
omserv-0.0.0.dev194.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
53
|
+
omserv-0.0.0.dev194.dist-info/entry_points.txt,sha256=ivSrdA_ahEbI-eVMu-XZS-z4VrnQISvpecIkOqC9zFM,35
|
54
|
+
omserv-0.0.0.dev194.dist-info/top_level.txt,sha256=HXehpnxeKscKNULzKNzZ27oNawBrsh1PaNAirbX-XNA,7
|
55
|
+
omserv-0.0.0.dev194.dist-info/RECORD,,
|
omserv/nginx/configs.py
DELETED
@@ -1,76 +0,0 @@
|
|
1
|
-
# ruff: noqa: UP006 UP007
|
2
|
-
# @omlish-lite
|
3
|
-
"""
|
4
|
-
TODO:
|
5
|
-
- omnibus/jmespath
|
6
|
-
|
7
|
-
https://nginx.org/en/docs/dev/development_guide.html
|
8
|
-
https://nginx.org/en/docs/dev/development_guide.html#config_directives
|
9
|
-
https://nginx.org/en/docs/example.html
|
10
|
-
|
11
|
-
https://github.com/yandex/gixy
|
12
|
-
"""
|
13
|
-
import collections.abc
|
14
|
-
import dataclasses as dc
|
15
|
-
import typing as ta
|
16
|
-
|
17
|
-
from omlish.lite.check import check
|
18
|
-
from omlish.text.indent import IndentWriter
|
19
|
-
|
20
|
-
|
21
|
-
@dc.dataclass()
|
22
|
-
class NginxConfigItems:
|
23
|
-
lst: ta.List['NginxConfigItem']
|
24
|
-
|
25
|
-
@classmethod
|
26
|
-
def of(cls, obj: ta.Any) -> 'NginxConfigItems':
|
27
|
-
if isinstance(obj, NginxConfigItems):
|
28
|
-
return obj
|
29
|
-
return cls([NginxConfigItem.of(e) for e in check.isinstance(obj, list)])
|
30
|
-
|
31
|
-
|
32
|
-
@dc.dataclass()
|
33
|
-
class NginxConfigItem:
|
34
|
-
name: str
|
35
|
-
args: ta.Optional[ta.List[str]] = None
|
36
|
-
block: ta.Optional[NginxConfigItems] = None
|
37
|
-
|
38
|
-
@classmethod
|
39
|
-
def of(cls, obj: ta.Any) -> 'NginxConfigItem':
|
40
|
-
if isinstance(obj, NginxConfigItem):
|
41
|
-
return obj
|
42
|
-
args = check.isinstance(check.not_isinstance(obj, str), collections.abc.Sequence)
|
43
|
-
name, args = check.isinstance(args[0], str), args[1:]
|
44
|
-
if args and not isinstance(args[-1], str):
|
45
|
-
block, args = NginxConfigItems.of(args[-1]), args[:-1]
|
46
|
-
else:
|
47
|
-
block = None
|
48
|
-
return NginxConfigItem(name, [check.isinstance(e, str) for e in args], block=block)
|
49
|
-
|
50
|
-
|
51
|
-
def render_nginx_config(wr: IndentWriter, obj: ta.Any) -> None:
|
52
|
-
if isinstance(obj, NginxConfigItem):
|
53
|
-
wr.write(obj.name)
|
54
|
-
for e in obj.args or ():
|
55
|
-
wr.write(' ')
|
56
|
-
wr.write(e)
|
57
|
-
if obj.block:
|
58
|
-
wr.write(' {\n')
|
59
|
-
with wr.indent():
|
60
|
-
render_nginx_config(wr, obj.block)
|
61
|
-
wr.write('}\n')
|
62
|
-
else:
|
63
|
-
wr.write(';\n')
|
64
|
-
|
65
|
-
elif isinstance(obj, NginxConfigItems):
|
66
|
-
for e2 in obj.lst:
|
67
|
-
render_nginx_config(wr, e2)
|
68
|
-
|
69
|
-
else:
|
70
|
-
raise TypeError(obj)
|
71
|
-
|
72
|
-
|
73
|
-
def render_nginx_config_str(obj: ta.Any) -> str:
|
74
|
-
iw = IndentWriter()
|
75
|
-
render_nginx_config(iw, obj)
|
76
|
-
return iw.getvalue()
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|