omlish 0.0.0.dev170__py3-none-any.whl → 0.0.0.dev172__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
omlish/.manifests.json CHANGED
@@ -121,6 +121,20 @@
121
121
  }
122
122
  }
123
123
  },
124
+ {
125
+ "module": ".formats.repr",
126
+ "attr": "_REPR_LAZY_CODEC",
127
+ "file": "omlish/formats/repr.py",
128
+ "line": 24,
129
+ "value": {
130
+ "$.codecs.base.LazyLoadedCodec": {
131
+ "mod_name": "omlish.formats.repr",
132
+ "attr_name": "REPR_CODEC",
133
+ "name": "repr",
134
+ "aliases": null
135
+ }
136
+ }
137
+ },
124
138
  {
125
139
  "module": ".formats.toml",
126
140
  "attr": "_TOML_LAZY_CODEC",
omlish/__about__.py CHANGED
@@ -1,5 +1,5 @@
1
- __version__ = '0.0.0.dev170'
2
- __revision__ = 'be0f1bb54e3cbc28c30a174a14aa4790f265a33a'
1
+ __version__ = '0.0.0.dev172'
2
+ __revision__ = 'e37ff8d8de7971241ac3ad5a24d9b2fdc38f56c9'
3
3
 
4
4
 
5
5
  #
omlish/formats/repr.py ADDED
@@ -0,0 +1,25 @@
1
+ import ast
2
+ import typing as ta
3
+
4
+ from .codecs import make_object_lazy_loaded_codec
5
+ from .codecs import make_str_object_codec
6
+
7
+
8
+ ##
9
+
10
+
11
+ def dumps(obj: ta.Any) -> str:
12
+ return repr(obj)
13
+
14
+
15
+ def loads(s: str) -> ta.Any:
16
+ return ast.literal_eval(s)
17
+
18
+
19
+ ##
20
+
21
+
22
+ REPR_CODEC = make_str_object_codec('repr', dumps, loads)
23
+
24
+ # @omlish-manifest
25
+ _REPR_LAZY_CODEC = make_object_lazy_loaded_codec(__name__, 'REPR_CODEC', REPR_CODEC)
@@ -2,7 +2,7 @@
2
2
  import dataclasses as dc
3
3
 
4
4
 
5
- def cache_dataclass_hash(
5
+ def dataclass_cache_hash(
6
6
  *,
7
7
  cached_hash_attr: str = '__dataclass_hash__',
8
8
  ):
omlish/lite/shlex.py ADDED
@@ -0,0 +1,12 @@
1
+ import shlex
2
+
3
+
4
+ def shlex_needs_quote(s: str) -> bool:
5
+ return bool(s) and len(list(shlex.shlex(s))) > 1
6
+
7
+
8
+ def shlex_maybe_quote(s: str) -> str:
9
+ if shlex_needs_quote(s):
10
+ return shlex.quote(s)
11
+ else:
12
+ return s
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: omlish
3
- Version: 0.0.0.dev170
3
+ Version: 0.0.0.dev172
4
4
  Summary: omlish
5
5
  Author: wrmsr
6
6
  License: BSD-3-Clause
@@ -1,5 +1,5 @@
1
- omlish/.manifests.json,sha256=0BnQGD2dcXEma0Jop2ZesvDNzSj3CAJBNq8aTGuBz9A,7276
2
- omlish/__about__.py,sha256=PoGd-lg7WxO1UiKHGhsCnxmHLiTfBft9-eJMax5A1Vs,3409
1
+ omlish/.manifests.json,sha256=lRkBDFxlAbf6lN5upo3WSf-owW8YG1T21dfpbQL-XHM,7598
2
+ omlish/__about__.py,sha256=FhrhH5_-1RC_koxri7HpjROhO4wDd-xo-r03wYYQwpU,3409
3
3
  omlish/__init__.py,sha256=SsyiITTuK0v74XpKV8dqNaCmjOlan1JZKrHQv5rWKPA,253
4
4
  omlish/c3.py,sha256=ubu7lHwss5V4UznbejAI0qXhXahrU01MysuHOZI9C4U,8116
5
5
  omlish/cached.py,sha256=UI-XTFBwA6YXWJJJeBn-WkwBkfzDjLBBaZf4nIJA9y0,510
@@ -217,6 +217,7 @@ omlish/formats/dotenv.py,sha256=qoDG4Ayu7B-8LjBBhcmNiLZW0_9LgCi3Ri2aPo9DEQ8,1931
217
217
  omlish/formats/json5.py,sha256=odpZIShlUpv19aACWe58SoMPcv0AHKIa6zSMjlKgaMI,515
218
218
  omlish/formats/pickle.py,sha256=jdp4E9WH9qVPBE3sSqbqDtUo18RbTSIiSpSzJ-IEVZw,529
219
219
  omlish/formats/props.py,sha256=cek3JLFLIrpE76gvs8rs_B8yF4SpY8ooDH8apWsquwE,18953
220
+ omlish/formats/repr.py,sha256=kYrNs4o-ji8nOdp6u_L3aMgBMWN1ZAZJSAWgQQfStSQ,414
220
221
  omlish/formats/toml.py,sha256=AhpVNAy87eBohBCsvIvwH2ucASWxnWXMEsMH8zB7rpI,340
221
222
  omlish/formats/xml.py,sha256=ggiOwSERt4d9XmZwLZiDIh5qnFJS4jdmow9m9_9USps,1491
222
223
  omlish/formats/yaml.py,sha256=ffOwGnLA6chdiFyaS7X0TBMGmHG9AoGudzKVWfQ1UOs,7389
@@ -377,7 +378,7 @@ omlish/lite/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
377
378
  omlish/lite/cached.py,sha256=O7ozcoDNFm1Hg2wtpHEqYSp_i_nCLNOP6Ueq_Uk-7mU,1300
378
379
  omlish/lite/check.py,sha256=0PD-GKtaDqDX6jU5KbzbMvH-vl6jH82xgYfplmfTQkg,12941
379
380
  omlish/lite/contextmanagers.py,sha256=m9JO--p7L7mSl4cycXysH-1AO27weDKjP3DZG61cwwM,1683
380
- omlish/lite/dataclasses.py,sha256=Yaf56l2Lor8bcPCnhRVxvLnJoFqxKf9l358b3WsK8SM,848
381
+ omlish/lite/dataclasses.py,sha256=gpEim20a_qRnK18WUipEcAFq4Hn1S0u0SpanbfZ8LWQ,848
381
382
  omlish/lite/inject.py,sha256=EEaioN9ESAveVCMe2s5osjwI97FPRUVoU8P95vGUiYo,23376
382
383
  omlish/lite/json.py,sha256=7-02Ny4fq-6YAu5ynvqoijhuYXWpLmfCI19GUeZnb1c,740
383
384
  omlish/lite/logs.py,sha256=CWFG0NKGhqNeEgryF5atN2gkPYbUdTINEw_s1phbINM,51
@@ -388,6 +389,7 @@ omlish/lite/reflect.py,sha256=L5_9gNp_BmAZ3l9PVezDmiXFg_6BOHbfQNB98tUULW0,1765
388
389
  omlish/lite/resources.py,sha256=YNSmX1Ohck1aoWRs55a-o5ChVbFJIQhtbqE-XwF55Oc,326
389
390
  omlish/lite/runtime.py,sha256=XQo408zxTdJdppUZqOWHyeUR50VlCpNIExNGHz4U6O4,459
390
391
  omlish/lite/secrets.py,sha256=3Mz3V2jf__XU9qNHcH56sBSw95L3U2UPL24bjvobG0c,816
392
+ omlish/lite/shlex.py,sha256=CGAgKv1rgrHPhSmY8ItKkiqHYOvXB9j_uL_6u8p2fqI,233
391
393
  omlish/lite/socket.py,sha256=7OYgkXTcQv0wq7TQuLnl9y6dJA1ZT6Vbc1JH59QlxgY,1792
392
394
  omlish/lite/socketserver.py,sha256=doTXIctu_6c8XneFtzPFVG_Wq6xVmA3p9ymut8IvBoU,1586
393
395
  omlish/lite/strings.py,sha256=nGWaOi9LzTjkc5kPN2IqsVN8PUw8m_2yllTGRUQU5PI,1983
@@ -567,9 +569,9 @@ omlish/text/glyphsplit.py,sha256=Ug-dPRO7x-OrNNr8g1y6DotSZ2KH0S-VcOmUobwa4B0,329
567
569
  omlish/text/indent.py,sha256=6Jj6TFY9unaPa4xPzrnZemJ-fHsV53IamP93XGjSUHs,1274
568
570
  omlish/text/parts.py,sha256=7vPF1aTZdvLVYJ4EwBZVzRSy8XB3YqPd7JwEnNGGAOo,6495
569
571
  omlish/text/random.py,sha256=jNWpqiaKjKyTdMXC-pWAsSC10AAP-cmRRPVhm59ZWLk,194
570
- omlish-0.0.0.dev170.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
571
- omlish-0.0.0.dev170.dist-info/METADATA,sha256=1zURRBI9Xgzn95Gk7PvYo_f_QCqUBqd_uNIFZZVBuHM,4264
572
- omlish-0.0.0.dev170.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
573
- omlish-0.0.0.dev170.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
574
- omlish-0.0.0.dev170.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
575
- omlish-0.0.0.dev170.dist-info/RECORD,,
572
+ omlish-0.0.0.dev172.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
573
+ omlish-0.0.0.dev172.dist-info/METADATA,sha256=NmaRtipxdQVzOJ-RKJly49mHX61rTwtiJ5tjgdWs3QA,4264
574
+ omlish-0.0.0.dev172.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
575
+ omlish-0.0.0.dev172.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
576
+ omlish-0.0.0.dev172.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
577
+ omlish-0.0.0.dev172.dist-info/RECORD,,