omdev 0.0.0.dev438__py3-none-any.whl → 0.0.0.dev439__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.
- omdev/__about__.py +1 -1
- omdev/amalg/gen/srcfiles.py +13 -0
- omdev/scripts/inject.py +2039 -0
- omdev/scripts/marshal.py +1689 -0
- omdev/tokens/utils.py +2 -1
- omdev/tools/json/cli.py +6 -6
- omdev/tools/json/parsing.py +5 -5
- omdev/tools/json/rendering.py +2 -2
- {omdev-0.0.0.dev438.dist-info → omdev-0.0.0.dev439.dist-info}/METADATA +4 -4
- {omdev-0.0.0.dev438.dist-info → omdev-0.0.0.dev439.dist-info}/RECORD +14 -12
- {omdev-0.0.0.dev438.dist-info → omdev-0.0.0.dev439.dist-info}/WHEEL +0 -0
- {omdev-0.0.0.dev438.dist-info → omdev-0.0.0.dev439.dist-info}/entry_points.txt +0 -0
- {omdev-0.0.0.dev438.dist-info → omdev-0.0.0.dev439.dist-info}/licenses/LICENSE +0 -0
- {omdev-0.0.0.dev438.dist-info → omdev-0.0.0.dev439.dist-info}/top_level.txt +0 -0
omdev/tokens/utils.py
CHANGED
@@ -27,6 +27,7 @@ def is_ws(tok: Token) -> bool:
|
|
27
27
|
def ignore_ws(
|
28
28
|
toks: ta.Iterable[Token],
|
29
29
|
*,
|
30
|
+
drop_nl: bool = False,
|
30
31
|
keep: ta.Container[str] = (),
|
31
32
|
) -> ta.Iterable[Token]:
|
32
33
|
if isinstance(keep, str):
|
@@ -34,7 +35,7 @@ def ignore_ws(
|
|
34
35
|
return (
|
35
36
|
t
|
36
37
|
for t in toks
|
37
|
-
if t.name in keep or t.name not in WS_NAMES
|
38
|
+
if t.name in keep or (t.name not in WS_NAMES and not (drop_nl and t.name == 'NL'))
|
38
39
|
)
|
39
40
|
|
40
41
|
|
omdev/tools/json/cli.py
CHANGED
@@ -195,7 +195,7 @@ def _main() -> None:
|
|
195
195
|
else:
|
196
196
|
in_file = es.enter_context(open(args.file, 'rb'))
|
197
197
|
|
198
|
-
def yield_input() -> ta.
|
198
|
+
def yield_input() -> ta.Iterator[bytes]:
|
199
199
|
fd = check.isinstance(in_file.fileno(), int)
|
200
200
|
|
201
201
|
while True:
|
@@ -240,7 +240,7 @@ def _main() -> None:
|
|
240
240
|
def flush_output(
|
241
241
|
fn: ta.Callable[[T], ta.Iterable[U]],
|
242
242
|
i: T,
|
243
|
-
) -> ta.
|
243
|
+
) -> ta.Iterator[U]:
|
244
244
|
n = 0
|
245
245
|
for o in fn(i):
|
246
246
|
yield o
|
@@ -259,7 +259,7 @@ def _main() -> None:
|
|
259
259
|
def append_newlines(
|
260
260
|
fn: ta.Callable[[T], ta.Iterable[str]],
|
261
261
|
i: T,
|
262
|
-
) -> ta.
|
262
|
+
) -> ta.Iterator[str]:
|
263
263
|
yield from fn(i)
|
264
264
|
yield '\n'
|
265
265
|
|
@@ -267,15 +267,15 @@ def _main() -> None:
|
|
267
267
|
pipeline = fp.bind(append_newlines, pipeline) # Any -> [str]
|
268
268
|
pipeline = fp.bind(lang.flatmap, pipeline) # [Any] -> [str]
|
269
269
|
pipeline = fp.pipe(fp.bind(lang.flatmap, processor.process), pipeline) # [Any] -> [str]
|
270
|
-
pipeline = fp.pipe(fp.bind(lang.flatmap, builder.build), pipeline) # [
|
270
|
+
pipeline = fp.pipe(fp.bind(lang.flatmap, builder.build), pipeline) # [Event] -> [str] # noqa
|
271
271
|
pipeline = fp.pipe(parser.parse, pipeline) # bytes -> [str]
|
272
272
|
|
273
273
|
else:
|
274
274
|
renderer = StreamRenderer(cfg.rendering)
|
275
275
|
trailing_newline = True
|
276
276
|
|
277
|
-
pipeline = renderer.render #
|
278
|
-
pipeline = fp.bind(lang.flatmap, pipeline) # [
|
277
|
+
pipeline = renderer.render # Event -> [str]
|
278
|
+
pipeline = fp.bind(lang.flatmap, pipeline) # [Event] -> [str]
|
279
279
|
pipeline = fp.pipe(parser.parse, pipeline) # bytes -> [str]
|
280
280
|
|
281
281
|
pipeline = fp.bind(flush_output, pipeline) # bytes -> [str]
|
omdev/tools/json/parsing.py
CHANGED
@@ -6,8 +6,8 @@ from omlish import check
|
|
6
6
|
from omlish import lang
|
7
7
|
from omlish.formats.json.stream.building import JsonValueBuilder
|
8
8
|
from omlish.formats.json.stream.lexing import JsonStreamLexer
|
9
|
+
from omlish.formats.json.stream.parsing import Event
|
9
10
|
from omlish.formats.json.stream.parsing import JsonStreamParser
|
10
|
-
from omlish.formats.json.stream.parsing import JsonStreamParserEvent
|
11
11
|
from omlish.io.buffers import DelimitingBuffer
|
12
12
|
|
13
13
|
from .formats import Format
|
@@ -22,7 +22,7 @@ class EagerParser:
|
|
22
22
|
|
23
23
|
self._fmt = fmt
|
24
24
|
|
25
|
-
def parse(self, f: ta.TextIO) -> ta.
|
25
|
+
def parse(self, f: ta.TextIO) -> ta.Iterator[ta.Any]:
|
26
26
|
return self._fmt.load(f)
|
27
27
|
|
28
28
|
|
@@ -42,7 +42,7 @@ class DelimitingParser:
|
|
42
42
|
|
43
43
|
self._db = DelimitingBuffer(delimiters)
|
44
44
|
|
45
|
-
def parse(self, b: bytes) -> ta.
|
45
|
+
def parse(self, b: bytes) -> ta.Iterator[ta.Any]:
|
46
46
|
for chunk in self._db.feed(b):
|
47
47
|
s = check.isinstance(chunk, bytes).decode('utf-8')
|
48
48
|
v = self._fmt.load(io.StringIO(s))
|
@@ -58,7 +58,7 @@ class StreamBuilder(lang.ExitStacked):
|
|
58
58
|
def _enter_contexts(self) -> None:
|
59
59
|
self._builder = self._enter_context(JsonValueBuilder())
|
60
60
|
|
61
|
-
def build(self, e:
|
61
|
+
def build(self, e: Event) -> ta.Iterator[ta.Any]:
|
62
62
|
yield from check.not_none(self._builder)(e)
|
63
63
|
|
64
64
|
|
@@ -72,7 +72,7 @@ class StreamParser(lang.ExitStacked):
|
|
72
72
|
self._lex = self._enter_context(JsonStreamLexer())
|
73
73
|
self._parse = self._enter_context(JsonStreamParser())
|
74
74
|
|
75
|
-
def parse(self, b: bytes) -> ta.
|
75
|
+
def parse(self, b: bytes) -> ta.Iterator[Event]:
|
76
76
|
for s in self._decoder.decode(b, not b):
|
77
77
|
for c in s:
|
78
78
|
for t in self._lex(c):
|
omdev/tools/json/rendering.py
CHANGED
@@ -4,7 +4,7 @@ import typing as ta
|
|
4
4
|
|
5
5
|
from omlish import lang
|
6
6
|
from omlish.formats.json.rendering import JsonRenderer
|
7
|
-
from omlish.formats.json.stream.parsing import
|
7
|
+
from omlish.formats.json.stream.parsing import Event
|
8
8
|
from omlish.formats.json.stream.rendering import StreamJsonRenderer
|
9
9
|
from omlish.formats.json5.rendering import Json5Renderer
|
10
10
|
from omlish.term import codes as tc
|
@@ -101,5 +101,5 @@ class StreamRenderer(Renderer):
|
|
101
101
|
**self._kw,
|
102
102
|
)
|
103
103
|
|
104
|
-
def render(self, e:
|
104
|
+
def render(self, e: Event) -> ta.Iterator[str]:
|
105
105
|
return self._renderer.render((e,))
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: omdev
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev439
|
4
4
|
Summary: omdev
|
5
5
|
Author: wrmsr
|
6
6
|
License-Expression: BSD-3-Clause
|
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
14
14
|
Requires-Python: >=3.13
|
15
15
|
Description-Content-Type: text/markdown
|
16
16
|
License-File: LICENSE
|
17
|
-
Requires-Dist: omlish==0.0.0.
|
17
|
+
Requires-Dist: omlish==0.0.0.dev439
|
18
18
|
Provides-Extra: all
|
19
19
|
Requires-Dist: black~=25.1; extra == "all"
|
20
20
|
Requires-Dist: pycparser~=2.23; extra == "all"
|
@@ -23,7 +23,7 @@ Requires-Dist: docutils~=0.22; extra == "all"
|
|
23
23
|
Requires-Dist: markdown-it-py~=4.0; extra == "all"
|
24
24
|
Requires-Dist: mdit-py-plugins~=0.5; extra == "all"
|
25
25
|
Requires-Dist: pygments~=2.19; extra == "all"
|
26
|
-
Requires-Dist: mypy~=1.
|
26
|
+
Requires-Dist: mypy~=1.18; extra == "all"
|
27
27
|
Requires-Dist: gprof2dot~=2025.4; extra == "all"
|
28
28
|
Requires-Dist: prompt-toolkit~=3.0; extra == "all"
|
29
29
|
Requires-Dist: segno~=1.6; extra == "all"
|
@@ -38,7 +38,7 @@ Requires-Dist: markdown-it-py~=4.0; extra == "doc"
|
|
38
38
|
Requires-Dist: mdit-py-plugins~=0.5; extra == "doc"
|
39
39
|
Requires-Dist: pygments~=2.19; extra == "doc"
|
40
40
|
Provides-Extra: mypy
|
41
|
-
Requires-Dist: mypy~=1.
|
41
|
+
Requires-Dist: mypy~=1.18; extra == "mypy"
|
42
42
|
Provides-Extra: prof
|
43
43
|
Requires-Dist: gprof2dot~=2025.4; extra == "prof"
|
44
44
|
Provides-Extra: ptk
|
@@ -1,5 +1,5 @@
|
|
1
1
|
omdev/.omlish-manifests.json,sha256=YvmHgYPueZ-uG4KeZAk0bOtw3GaDfld_nYnSng2Pz_I,11909
|
2
|
-
omdev/__about__.py,sha256=
|
2
|
+
omdev/__about__.py,sha256=jGBKcjGKlquwFQNwnAR0Yoglh8h8UZ0Nh7h46HIXTTQ,1202
|
3
3
|
omdev/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
omdev/cmake.py,sha256=gu49t10_syXh_TUJs4POsxeFs8we8Y3XTOOPgIXmGvg,4608
|
5
5
|
omdev/imgur.py,sha256=oqei705LhSnLWQTOMHMHwRecRXcpSEP90Sg4SVINPQ0,3133
|
@@ -15,7 +15,7 @@ omdev/amalg/gen/gen.py,sha256=95iQT0At_NsMf4IEg702ZOmmyEdhCZJGcSCFypm1BTk,6194
|
|
15
15
|
omdev/amalg/gen/imports.py,sha256=Bv3xNgej1Nsuv5R_y-9wd9b8cPtWljZsxjMh9bolJWc,2074
|
16
16
|
omdev/amalg/gen/manifests.py,sha256=SN4wvPZ8iNTcQIdpSZ6d64cL32pSlT_ak_GwctTPn_Y,903
|
17
17
|
omdev/amalg/gen/resources.py,sha256=wxqrudGbHzru2KWu-a_4LDmOf7tRRCd8NM0BXx_ZU9I,2693
|
18
|
-
omdev/amalg/gen/srcfiles.py,sha256=
|
18
|
+
omdev/amalg/gen/srcfiles.py,sha256=50HAAzsrJi-mV2r2Q1eQUJNgoSSP8qqe1xcaUN1GTRA,3506
|
19
19
|
omdev/amalg/gen/strip.py,sha256=GW76ZWJNdwH8dxLDG7gVHFi_CnS958fWvSfroD0HCaw,1446
|
20
20
|
omdev/amalg/gen/types.py,sha256=DvxUmEenqCeXycRHi4brxAkSjztq800qT1XlT94bXAY,90
|
21
21
|
omdev/amalg/gen/typing.py,sha256=VWw4_iZXqM_29ElSVUlLTO6-KLUCQPdieQDvG_q1YsI,2301
|
@@ -274,14 +274,16 @@ omdev/pyproject/resources/docker-dev.sh,sha256=DHkz5D18jok_oDolfg2mqrvGRWFoCe9GQ
|
|
274
274
|
omdev/pyproject/resources/python.sh,sha256=rFaN4SiJ9hdLDXXsDTwugI6zsw6EPkgYMmtacZeTbvw,749
|
275
275
|
omdev/scripts/__init__.py,sha256=MKCvUAEQwsIvwLixwtPlpBqmkMXLCnjjXyAXvVpDwVk,91
|
276
276
|
omdev/scripts/ci.py,sha256=53xZyiwiMQpi8dh4I5Fs_HjIgF_QcOGkKLmI7goPrF4,423536
|
277
|
+
omdev/scripts/inject.py,sha256=b0D8HbPALRwtg2r5T6B1UutTkQvVQm-58zT6uHPVjxQ,53700
|
277
278
|
omdev/scripts/interp.py,sha256=-mZ0RUnDiq-798F_HDt1OQG8k0hiWbSmaR8iepuwfyo,166643
|
279
|
+
omdev/scripts/marshal.py,sha256=scyQMuEKzEejoe8eC2wZLCS57CTVQ8RS58UxKiSLD90,46832
|
278
280
|
omdev/scripts/pyproject.py,sha256=YAM8FbJ6dV0gAGFchRajPqmL0gpQc1S8uKxdQjaIay8,330699
|
279
281
|
omdev/scripts/slowcat.py,sha256=PwdT-pg62imEEb6kcOozl9_YUi-4KopvjvzWT1OmGb0,2717
|
280
282
|
omdev/scripts/tmpexec.py,sha256=t0nErDRALjTk7H0X8ADjZUIDFjlPNzOOokmjCjBHdzs,1431
|
281
283
|
omdev/tokens/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
282
284
|
omdev/tokens/all.py,sha256=Zz7miOWeBDYfOEgKyeIGHooLvr9r31HlI04eqYWBUpU,806
|
283
285
|
omdev/tokens/tokenizert.py,sha256=BvDjXjaeM3_sMq9i-oojuKcAuGzSkbCso-Yt-gNKxeQ,7910
|
284
|
-
omdev/tokens/utils.py,sha256=
|
286
|
+
omdev/tokens/utils.py,sha256=_dlXx-_npiGeZkMZVbXaXQDGts9yY8UnEJcT_bwPj0A,2084
|
285
287
|
omdev/tools/__init__.py,sha256=iVJAOQ0viGTQOm0DLX4uZLro-9jOioYJGLg9s0kDx1A,78
|
286
288
|
omdev/tools/cloc.py,sha256=BiIf2PnnoRH6ByH4mnua69Vv-ZDPHsSAPUds7giRolI,6013
|
287
289
|
omdev/tools/diff.py,sha256=S6ddB7pBeMtzKh2hiHfzQ93pj6mclKt1UZQMKy4Bt5M,520
|
@@ -304,12 +306,12 @@ omdev/tools/git/consts.py,sha256=JuXivUNDkNhM4pe97icjRVAKM8cNRbrODquHINNKqOE,40
|
|
304
306
|
omdev/tools/git/messages.py,sha256=R39pXfXt8394eC99rpTdRlbcMrAdLxwsgTR4pwRRa-o,2321
|
305
307
|
omdev/tools/json/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
306
308
|
omdev/tools/json/__main__.py,sha256=wqpkN_NsQyNwKW4qjVj8ADJ4_C98KhrFBtE-Z1UamfU,168
|
307
|
-
omdev/tools/json/cli.py,sha256=
|
309
|
+
omdev/tools/json/cli.py,sha256=d7i5aPsFGIfHirY1U845t7gARpy3mu1YtvYa-qBkQF4,10142
|
308
310
|
omdev/tools/json/formats.py,sha256=1qGYb8Kq_yFpLMaecBg-XE3yWSvqRiRbBX8SAElpS9s,2643
|
309
311
|
omdev/tools/json/io.py,sha256=sfj2hJS9Hy3aUR8a_lLzOrYcmL9fSKyvOHiofdUASsI,1427
|
310
|
-
omdev/tools/json/parsing.py,sha256=
|
312
|
+
omdev/tools/json/parsing.py,sha256=R7h-UkwFm3Q0L8oHTk-aLtQN6x32-vkDXwLUxExL0tI,2000
|
311
313
|
omdev/tools/json/processing.py,sha256=jMSkTmIccdVkT_Q6Jf8Q4AG4BQecQfrp8G2bEtsklg8,2387
|
312
|
-
omdev/tools/json/rendering.py,sha256=
|
314
|
+
omdev/tools/json/rendering.py,sha256=dsZki-47lPuYP_-x7gFFl57IZnCJUXHS-NBGpQZjvk0,2628
|
313
315
|
omdev/tools/jsonview/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
314
316
|
omdev/tools/jsonview/__main__.py,sha256=BF-MVWpPJJeQYUqJA48G395kxw0lEJnV-hRLV_F9G2A,173
|
315
317
|
omdev/tools/jsonview/cli.py,sha256=8pHULS_xxDV00kM8bO5dLH7i-zqQIoNjXTKFwhxSZ_A,4245
|
@@ -319,9 +321,9 @@ omdev/tools/jsonview/resources/jsonview.js,sha256=faDvXDOXKvEvjOuIlz4D3F2ReQXb_b
|
|
319
321
|
omdev/tools/pawk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
320
322
|
omdev/tools/pawk/__main__.py,sha256=VCqeRVnqT1RPEoIrqHFSu4PXVMg4YEgF4qCQm90-eRI,66
|
321
323
|
omdev/tools/pawk/pawk.py,sha256=ao5mdrpiSU4AZ8mBozoEaV3UVlmVTnRG9wD9XP70MZE,11429
|
322
|
-
omdev-0.0.0.
|
323
|
-
omdev-0.0.0.
|
324
|
-
omdev-0.0.0.
|
325
|
-
omdev-0.0.0.
|
326
|
-
omdev-0.0.0.
|
327
|
-
omdev-0.0.0.
|
324
|
+
omdev-0.0.0.dev439.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
325
|
+
omdev-0.0.0.dev439.dist-info/METADATA,sha256=Efv8gVlchv6Cw6-DQgiYobMfsQxRRczgHoaMsQu2kRo,5100
|
326
|
+
omdev-0.0.0.dev439.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
327
|
+
omdev-0.0.0.dev439.dist-info/entry_points.txt,sha256=dHLXFmq5D9B8qUyhRtFqTGWGxlbx3t5ejedjrnXNYLU,33
|
328
|
+
omdev-0.0.0.dev439.dist-info/top_level.txt,sha256=1nr7j30fEWgLYHW3lGR9pkdHkb7knv1U1ES1XRNVQ6k,6
|
329
|
+
omdev-0.0.0.dev439.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|