omlish 0.0.0.dev288__py3-none-any.whl → 0.0.0.dev289__py3-none-any.whl
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.
- omlish/__about__.py +2 -2
- omlish/diag/pycharm.py +7 -3
- omlish/text/minja.py +26 -14
- omlish/text/templating.py +4 -0
- {omlish-0.0.0.dev288.dist-info → omlish-0.0.0.dev289.dist-info}/METADATA +1 -1
- {omlish-0.0.0.dev288.dist-info → omlish-0.0.0.dev289.dist-info}/RECORD +10 -10
- {omlish-0.0.0.dev288.dist-info → omlish-0.0.0.dev289.dist-info}/WHEEL +0 -0
- {omlish-0.0.0.dev288.dist-info → omlish-0.0.0.dev289.dist-info}/entry_points.txt +0 -0
- {omlish-0.0.0.dev288.dist-info → omlish-0.0.0.dev289.dist-info}/licenses/LICENSE +0 -0
- {omlish-0.0.0.dev288.dist-info → omlish-0.0.0.dev289.dist-info}/top_level.txt +0 -0
omlish/__about__.py
CHANGED
omlish/diag/pycharm.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import dataclasses as dc
|
2
2
|
import json
|
3
3
|
import os.path
|
4
|
-
import plistlib
|
5
4
|
import re
|
6
5
|
import shutil
|
7
6
|
import subprocess
|
@@ -13,10 +12,15 @@ from .. import lang
|
|
13
12
|
|
14
13
|
|
15
14
|
if ta.TYPE_CHECKING:
|
16
|
-
|
17
|
-
|
15
|
+
import plistlib
|
16
|
+
|
18
17
|
from .. import docker
|
19
18
|
|
19
|
+
else:
|
20
|
+
plistlib = lang.proxy_import('plistlib')
|
21
|
+
|
22
|
+
docker = lang.proxy_import('..docker')
|
23
|
+
|
20
24
|
|
21
25
|
##
|
22
26
|
|
omlish/text/minja.py
CHANGED
@@ -18,19 +18,6 @@ from ..lite.maybes import Maybe
|
|
18
18
|
##
|
19
19
|
|
20
20
|
|
21
|
-
class MinjaTemplate:
|
22
|
-
def __init__(self, fn: ta.Callable) -> None:
|
23
|
-
super().__init__()
|
24
|
-
|
25
|
-
self._fn = fn
|
26
|
-
|
27
|
-
def __call__(self, **kwargs: ta.Any) -> str:
|
28
|
-
return self._fn(**kwargs)
|
29
|
-
|
30
|
-
|
31
|
-
##
|
32
|
-
|
33
|
-
|
34
21
|
@dc.dataclass(frozen=True)
|
35
22
|
class MinjaTemplateParam:
|
36
23
|
name: str
|
@@ -59,6 +46,28 @@ class MinjaTemplateParam:
|
|
59
46
|
return cls(name, dfl)
|
60
47
|
|
61
48
|
|
49
|
+
class MinjaTemplate:
|
50
|
+
def __init__(
|
51
|
+
self,
|
52
|
+
fn: ta.Callable,
|
53
|
+
params: ta.Sequence[MinjaTemplateParam],
|
54
|
+
) -> None:
|
55
|
+
super().__init__()
|
56
|
+
|
57
|
+
self._fn = fn
|
58
|
+
self._params = params
|
59
|
+
|
60
|
+
@property
|
61
|
+
def params(self) -> ta.Sequence[MinjaTemplateParam]:
|
62
|
+
return self._params
|
63
|
+
|
64
|
+
def __call__(self, **kwargs: ta.Any) -> str:
|
65
|
+
return self._fn(**kwargs)
|
66
|
+
|
67
|
+
|
68
|
+
##
|
69
|
+
|
70
|
+
|
62
71
|
class MinjaTemplateCompiler:
|
63
72
|
"""
|
64
73
|
Compiles a template string into a Python function. The returned function takes a dictionary 'context' and returns
|
@@ -261,7 +270,10 @@ class MinjaTemplateCompiler:
|
|
261
270
|
rendered.ns,
|
262
271
|
)
|
263
272
|
|
264
|
-
return MinjaTemplate(
|
273
|
+
return MinjaTemplate(
|
274
|
+
render_fn,
|
275
|
+
self._params,
|
276
|
+
)
|
265
277
|
|
266
278
|
|
267
279
|
##
|
omlish/text/templating.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
omlish/.manifests.json,sha256=pjGUyLHaoWpPqRP3jz2u1fC1qoRc2lvrEcpU_Ax2tdg,8253
|
2
|
-
omlish/__about__.py,sha256=
|
2
|
+
omlish/__about__.py,sha256=HbhZmTysZ2WI-rCErh6ZBDj_chq-_Q4au1A12QYY1v4,3444
|
3
3
|
omlish/__init__.py,sha256=SsyiITTuK0v74XpKV8dqNaCmjOlan1JZKrHQv5rWKPA,253
|
4
4
|
omlish/c3.py,sha256=rer-TPOFDU6fYq_AWio_AmA-ckZ8JDY5shIzQ_yXfzA,8414
|
5
5
|
omlish/cached.py,sha256=MLap_p0rdGoDIMVhXVHm1tsbcWobJF0OanoodV03Ju8,542
|
@@ -277,7 +277,7 @@ omlish/diag/lsof.py,sha256=DnowqvKYah-WCuBHS3DAcZCvlsWJdM9kYNFq97UZDDA,9127
|
|
277
277
|
omlish/diag/procfs.py,sha256=KaGTAA2Gj8eEEp7MjClRe4aimwzd-HDABThFzvq2cBQ,9684
|
278
278
|
omlish/diag/procstats.py,sha256=UkqxREqfd-38xPYZ9T1SIJISz5ARQCEhTtOZrxtm2dE,777
|
279
279
|
omlish/diag/ps.py,sha256=b7ai9O4mGZliNFvBu6PdQfMmct4qpcMTygEf1ISHBLQ,1666
|
280
|
-
omlish/diag/pycharm.py,sha256=
|
280
|
+
omlish/diag/pycharm.py,sha256=Z2W-Viqw5xq08ZC4z36skpozfYw_qNNhWQx_GYr2D0k,4695
|
281
281
|
omlish/diag/pydevd.py,sha256=UN55ZjkWLCVyHxE2CNRRYamuvSKfzWsn0D5oczRTXO4,7536
|
282
282
|
omlish/diag/threads.py,sha256=1-x02VCDZ407gfbtXm1pWK-ubqhqfePm9PMqkHCVoqk,3642
|
283
283
|
omlish/diag/_pycharm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -816,10 +816,10 @@ omlish/text/glyphsplit.py,sha256=HI8TWDUaF_tJG5RnIdIjtUH_lYnjYZ7KZBANSxOXGZc,380
|
|
816
816
|
omlish/text/indent.py,sha256=LOQgHskHMLVrRC6HLL9uIWay517dpvPEYQK0Igm-wm8,1341
|
817
817
|
omlish/text/linecache.py,sha256=hRYlEhD63ZfA6_ZOTkQIcnON-3W56QMAhcG3vEJqj9M,1858
|
818
818
|
omlish/text/mangle.py,sha256=d7j2_HPxoxF5VrLD1TShOSfnhBLH_-lQe_OH2kl0yHg,2790
|
819
|
-
omlish/text/minja.py,sha256=
|
819
|
+
omlish/text/minja.py,sha256=FH2xcZUby-yB1CQwCUGmpvHmE1nCmfNX1h0Nm6ix8ck,7515
|
820
820
|
omlish/text/parts.py,sha256=Q9NvoyEGQKIWgiPD4D_Qc66cWAuyEKE033dT9m7c3Wk,6662
|
821
821
|
omlish/text/random.py,sha256=8feS5JE_tSjYlMl-lp0j93kCfzBae9AM2cXlRLebXMA,199
|
822
|
-
omlish/text/templating.py,sha256=
|
822
|
+
omlish/text/templating.py,sha256=azhKpvkDR2uby8k3AJ8Y6GpdKVQUb7Xt_cGbDz6dkTM,2454
|
823
823
|
omlish/text/go/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
824
824
|
omlish/text/go/quoting.py,sha256=N9EYdnFdEX_A8fOviH-1w4jwV3XOQ7VU2WsoUNubYVY,9137
|
825
825
|
omlish/typedvalues/__init__.py,sha256=c3IQmRneMmH6JRcafprqmBILWD89b-IyIll6MgahGCI,562
|
@@ -830,9 +830,9 @@ omlish/typedvalues/holder.py,sha256=4SwRezsmuDDEO5gENGx8kTm30pblF5UktoEAu02i-Gk,
|
|
830
830
|
omlish/typedvalues/marshal.py,sha256=Rr-4DZ90BoD5Z9gT18QhZH2yMA3-gPJBK8GUrGkp8VA,4245
|
831
831
|
omlish/typedvalues/reflect.py,sha256=y_7IY8_4cLVRvD3ug-_-cDaO5RtzC1rLVFzkeAPALf8,683
|
832
832
|
omlish/typedvalues/values.py,sha256=Q_5IiQM3Vka4wGVd-scaslb4-oCMjFcIOksIrKE-JIM,1229
|
833
|
-
omlish-0.0.0.
|
834
|
-
omlish-0.0.0.
|
835
|
-
omlish-0.0.0.
|
836
|
-
omlish-0.0.0.
|
837
|
-
omlish-0.0.0.
|
838
|
-
omlish-0.0.0.
|
833
|
+
omlish-0.0.0.dev289.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
834
|
+
omlish-0.0.0.dev289.dist-info/METADATA,sha256=qBFa2LeCS8dTuxmfIIrmiUFQBzIm5bR_MqfY2GlweLc,4316
|
835
|
+
omlish-0.0.0.dev289.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
836
|
+
omlish-0.0.0.dev289.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
|
837
|
+
omlish-0.0.0.dev289.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
|
838
|
+
omlish-0.0.0.dev289.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|