omdev 0.0.0.dev359__py3-none-any.whl → 0.0.0.dev361__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/.manifests.json +1 -1
- omdev/cli/clicli.py +9 -5
- omdev/tools/json/cli.py +2 -0
- omdev/tools/json/formats.py +15 -0
- omdev/tools/json/parsing.py +3 -3
- omdev/tools/json/rendering.py +2 -0
- {omdev-0.0.0.dev359.dist-info → omdev-0.0.0.dev361.dist-info}/METADATA +2 -2
- {omdev-0.0.0.dev359.dist-info → omdev-0.0.0.dev361.dist-info}/RECORD +12 -12
- {omdev-0.0.0.dev359.dist-info → omdev-0.0.0.dev361.dist-info}/WHEEL +0 -0
- {omdev-0.0.0.dev359.dist-info → omdev-0.0.0.dev361.dist-info}/entry_points.txt +0 -0
- {omdev-0.0.0.dev359.dist-info → omdev-0.0.0.dev361.dist-info}/licenses/LICENSE +0 -0
- {omdev-0.0.0.dev359.dist-info → omdev-0.0.0.dev361.dist-info}/top_level.txt +0 -0
omdev/.manifests.json
CHANGED
omdev/cli/clicli.py
CHANGED
@@ -133,9 +133,10 @@ class CliCli(ap.Cli):
|
|
133
133
|
])
|
134
134
|
|
135
135
|
if self.args.no_uv:
|
136
|
-
|
136
|
+
pip_install_cmd = [
|
137
137
|
venv_exe,
|
138
138
|
'-m', 'pip',
|
139
|
+
'install',
|
139
140
|
]
|
140
141
|
else:
|
141
142
|
subprocess.check_call([
|
@@ -144,25 +145,28 @@ class CliCli(ap.Cli):
|
|
144
145
|
'install',
|
145
146
|
'uv',
|
146
147
|
])
|
147
|
-
|
148
|
+
pip_install_cmd = [
|
148
149
|
venv_exe,
|
149
150
|
'-m', 'uv',
|
150
151
|
'pip',
|
152
|
+
'install',
|
153
|
+
'--refresh',
|
151
154
|
]
|
152
155
|
|
153
156
|
subprocess.check_call([
|
154
|
-
*
|
155
|
-
'install',
|
157
|
+
*pip_install_cmd,
|
156
158
|
'--dry-run',
|
157
159
|
f'{install.DEFAULT_CLI_PKG}=={target_version}',
|
158
160
|
*deps,
|
159
161
|
])
|
160
162
|
|
161
|
-
print('
|
163
|
+
print('venv install check successful')
|
162
164
|
|
163
165
|
else:
|
164
166
|
print('venv not present, cannot check install')
|
165
167
|
|
168
|
+
print()
|
169
|
+
|
166
170
|
#
|
167
171
|
|
168
172
|
if deps:
|
omdev/tools/json/cli.py
CHANGED
@@ -98,6 +98,7 @@ def _build_args_parser() -> argparse.ArgumentParser:
|
|
98
98
|
parser.add_argument('-U', '--unicode', action='store_true')
|
99
99
|
parser.add_argument('-c', '--color', action='store_true')
|
100
100
|
parser.add_argument('-5', '--five', action='store_true')
|
101
|
+
parser.add_argument('-W', '--softwrap', type=int)
|
101
102
|
|
102
103
|
parser.add_argument('-L', '--less', action='store_true')
|
103
104
|
|
@@ -161,6 +162,7 @@ def _process_args(args: ta.Any) -> RunConfiguration:
|
|
161
162
|
unicode=args.unicode,
|
162
163
|
color=args.color,
|
163
164
|
five=args.five,
|
165
|
+
softwrap_length=args.softwrap,
|
164
166
|
)
|
165
167
|
|
166
168
|
#
|
omdev/tools/json/formats.py
CHANGED
@@ -23,6 +23,8 @@ if ta.TYPE_CHECKING:
|
|
23
23
|
from omlish.formats import json5
|
24
24
|
from omlish.formats import props
|
25
25
|
from omlish.formats import xml
|
26
|
+
from omlish.formats.json import stream as json_stream
|
27
|
+
from omlish.formats.json5 import parsing as json5_parsing
|
26
28
|
|
27
29
|
else:
|
28
30
|
ast = lang.proxy_import('ast')
|
@@ -35,6 +37,8 @@ else:
|
|
35
37
|
json5 = lang.proxy_import('omlish.formats.json5')
|
36
38
|
props = lang.proxy_import('omlish.formats.props')
|
37
39
|
xml = lang.proxy_import('omlish.formats.xml')
|
40
|
+
json_stream = lang.proxy_import('omlish.formats.json.stream')
|
41
|
+
json5_parsing = lang.proxy_import('omlish.formats.json5.parsing')
|
38
42
|
|
39
43
|
|
40
44
|
##
|
@@ -46,6 +50,14 @@ class Format:
|
|
46
50
|
load: ta.Callable[[ta.TextIO], ta.Any]
|
47
51
|
|
48
52
|
|
53
|
+
def _load_jsons(f: ta.TextIO) -> list[ta.Any]:
|
54
|
+
return list(json_stream.stream_parse_values(f.read()))
|
55
|
+
|
56
|
+
|
57
|
+
def _load_json5s(f: ta.TextIO) -> list[ta.Any]:
|
58
|
+
return list(json5_parsing.parse_many(f.read()))
|
59
|
+
|
60
|
+
|
49
61
|
def _load_xml(f: ta.TextIO) -> dict[str, ta.Any]:
|
50
62
|
tree = xml.parse_tree(f.read())
|
51
63
|
sel = xml.build_simple_element(check.not_none(tree.getroot()))
|
@@ -57,6 +69,9 @@ class Formats(enum.Enum):
|
|
57
69
|
|
58
70
|
JSON5 = Format(['json5'], lambda f: json5.loads(f.read()))
|
59
71
|
|
72
|
+
JSON_STREAM = Format(['jsons'], lambda f: _load_jsons(f))
|
73
|
+
JSON5_STREAM = Format(['json5s'], lambda f: _load_json5s(f))
|
74
|
+
|
60
75
|
YAML = Format(['yaml', 'yml'], lambda f: yaml.safe_load(f))
|
61
76
|
|
62
77
|
TOML = Format(['toml'], lambda f: tomllib.loads(f.read()))
|
omdev/tools/json/parsing.py
CHANGED
@@ -4,7 +4,7 @@ import typing as ta
|
|
4
4
|
|
5
5
|
from omlish import check
|
6
6
|
from omlish import lang
|
7
|
-
from omlish.formats.json.stream.building import
|
7
|
+
from omlish.formats.json.stream.building import JsonValueBuilder
|
8
8
|
from omlish.formats.json.stream.lexing import JsonStreamLexer
|
9
9
|
from omlish.formats.json.stream.parsing import JsonStreamParser
|
10
10
|
from omlish.formats.json.stream.parsing import JsonStreamParserEvent
|
@@ -53,10 +53,10 @@ class DelimitingParser:
|
|
53
53
|
|
54
54
|
|
55
55
|
class StreamBuilder(lang.ExitStacked):
|
56
|
-
_builder:
|
56
|
+
_builder: JsonValueBuilder | None = None
|
57
57
|
|
58
58
|
def _enter_contexts(self) -> None:
|
59
|
-
self._builder = self._enter_context(
|
59
|
+
self._builder = self._enter_context(JsonValueBuilder())
|
60
60
|
|
61
61
|
def build(self, e: JsonStreamParserEvent) -> ta.Generator[ta.Any]:
|
62
62
|
yield from check.not_none(self._builder)(e)
|
omdev/tools/json/rendering.py
CHANGED
@@ -22,6 +22,7 @@ class RenderingOptions:
|
|
22
22
|
unicode: bool = False
|
23
23
|
color: bool = False
|
24
24
|
five: bool = False
|
25
|
+
softwrap_length: int | None = None
|
25
26
|
|
26
27
|
|
27
28
|
def make_render_kwargs(opts: RenderingOptions) -> ta.Mapping[str, ta.Any]:
|
@@ -69,6 +70,7 @@ class EagerRenderer(Renderer):
|
|
69
70
|
**self._kw,
|
70
71
|
**(dict(style=term_color) if self._opts.color else {}),
|
71
72
|
multiline_strings=True,
|
73
|
+
softwrap_length=self._opts.softwrap_length,
|
72
74
|
)
|
73
75
|
|
74
76
|
elif self._opts.color:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: omdev
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev361
|
4
4
|
Summary: omdev
|
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.13
|
14
14
|
License-File: LICENSE
|
15
|
-
Requires-Dist: omlish==0.0.0.
|
15
|
+
Requires-Dist: omlish==0.0.0.dev361
|
16
16
|
Provides-Extra: all
|
17
17
|
Requires-Dist: black~=25.1; extra == "all"
|
18
18
|
Requires-Dist: pycparser~=2.22; extra == "all"
|
@@ -1,4 +1,4 @@
|
|
1
|
-
omdev/.manifests.json,sha256=
|
1
|
+
omdev/.manifests.json,sha256=gUmQyNfvds3Q_9p7PzDJGfOrUUkPWOUN0c_K_9uRPs4,11870
|
2
2
|
omdev/__about__.py,sha256=2_6pQyjxqAspvwBSJUWQgdBBcGaDO3zX8yETLaspUQE,1202
|
3
3
|
omdev/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
omdev/cmake.py,sha256=9rfSvFHPmKDj9ngvfDB2vK8O-xO_ZwUm7hMKLWA-yOw,4578
|
@@ -103,7 +103,7 @@ omdev/ci/github/api/v2/client.py,sha256=bJtL_TZ4sB6IDuzfqtEXj-iWivKfyXQZ_MO30lgB
|
|
103
103
|
omdev/cli/__init__.py,sha256=V_l6VP1SZMlJbO-8CJwSuO9TThOy2S_oaPepNYgIrbE,37
|
104
104
|
omdev/cli/__main__.py,sha256=mOJpgc07o0r5luQ1DlX4tk2PqZkgmbwPbdzJ3KmtjgQ,138
|
105
105
|
omdev/cli/_pathhack.py,sha256=UshIZX3oeXq0De-9X28gy2LgKMZDf_dzabdkUhZJdNA,2124
|
106
|
-
omdev/cli/clicli.py,sha256=
|
106
|
+
omdev/cli/clicli.py,sha256=TZnQYHyyh97B6N_pVYYduYgt03s8Yp5mrJ7wblXWSWY,6308
|
107
107
|
omdev/cli/install.py,sha256=oB34AOwu07sqEztW_z5mgorAFoP_Tw556XiTPj2WSM0,4904
|
108
108
|
omdev/cli/main.py,sha256=dxZFyzKuwRykHHhoKKUA0fUa9QsY0dgdvLHbXNuIPCY,6694
|
109
109
|
omdev/cli/managers.py,sha256=BV98_n30Jj63OJrFgRoVZRfICxMLXEZKoEn4rMj9LV4,1160
|
@@ -288,12 +288,12 @@ omdev/tools/git/consts.py,sha256=JuXivUNDkNhM4pe97icjRVAKM8cNRbrODquHINNKqOE,40
|
|
288
288
|
omdev/tools/git/messages.py,sha256=NWztIK0nAKJIOVzuVQcR_5LHZUgqyVkrOlpl7dFLMdU,2424
|
289
289
|
omdev/tools/json/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
290
290
|
omdev/tools/json/__main__.py,sha256=wqpkN_NsQyNwKW4qjVj8ADJ4_C98KhrFBtE-Z1UamfU,168
|
291
|
-
omdev/tools/json/cli.py,sha256=
|
292
|
-
omdev/tools/json/formats.py,sha256=
|
291
|
+
omdev/tools/json/cli.py,sha256=v8YsChDN97y7XDsNRs3zimCAwCkJQkMDcd8CXhfUVGY,10087
|
292
|
+
omdev/tools/json/formats.py,sha256=1qGYb8Kq_yFpLMaecBg-XE3yWSvqRiRbBX8SAElpS9s,2643
|
293
293
|
omdev/tools/json/io.py,sha256=sfj2hJS9Hy3aUR8a_lLzOrYcmL9fSKyvOHiofdUASsI,1427
|
294
|
-
omdev/tools/json/parsing.py,sha256=
|
294
|
+
omdev/tools/json/parsing.py,sha256=xZiOH3jSVErNGKI8AysFf0zzyhivXvRakTQe7rWxhKQ,2052
|
295
295
|
omdev/tools/json/processing.py,sha256=KVMVyW5dTaoPyjn2Aabkay4tBn5cwJJXtLQaJgZI7ZY,2016
|
296
|
-
omdev/tools/json/rendering.py,sha256=
|
296
|
+
omdev/tools/json/rendering.py,sha256=KilwK8ziHGy3Z76H9CC04x2ro5Rkws1d06D0j6TnHA4,2660
|
297
297
|
omdev/tools/jsonview/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
298
298
|
omdev/tools/jsonview/__main__.py,sha256=BF-MVWpPJJeQYUqJA48G395kxw0lEJnV-hRLV_F9G2A,173
|
299
299
|
omdev/tools/jsonview/cli.py,sha256=8pHULS_xxDV00kM8bO5dLH7i-zqQIoNjXTKFwhxSZ_A,4245
|
@@ -303,9 +303,9 @@ omdev/tools/jsonview/resources/jsonview.js,sha256=faDvXDOXKvEvjOuIlz4D3F2ReQXb_b
|
|
303
303
|
omdev/tools/pawk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
304
304
|
omdev/tools/pawk/__main__.py,sha256=VCqeRVnqT1RPEoIrqHFSu4PXVMg4YEgF4qCQm90-eRI,66
|
305
305
|
omdev/tools/pawk/pawk.py,sha256=zsEkfQX0jF5bn712uqPAyBSdJt2dno1LH2oeSMNfXQI,11424
|
306
|
-
omdev-0.0.0.
|
307
|
-
omdev-0.0.0.
|
308
|
-
omdev-0.0.0.
|
309
|
-
omdev-0.0.0.
|
310
|
-
omdev-0.0.0.
|
311
|
-
omdev-0.0.0.
|
306
|
+
omdev-0.0.0.dev361.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
307
|
+
omdev-0.0.0.dev361.dist-info/METADATA,sha256=RwOgZ_VgNHtw7VEnM8WzMwzobN3T2jeZzqUDrrkv_7Y,1674
|
308
|
+
omdev-0.0.0.dev361.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
309
|
+
omdev-0.0.0.dev361.dist-info/entry_points.txt,sha256=dHLXFmq5D9B8qUyhRtFqTGWGxlbx3t5ejedjrnXNYLU,33
|
310
|
+
omdev-0.0.0.dev361.dist-info/top_level.txt,sha256=1nr7j30fEWgLYHW3lGR9pkdHkb7knv1U1ES1XRNVQ6k,6
|
311
|
+
omdev-0.0.0.dev361.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|