omlish 0.0.0.dev201__py3-none-any.whl → 0.0.0.dev202__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- omlish/__about__.py +2 -2
- omlish/formats/props.py +1 -2
- omlish/lang/__init__.py +2 -1
- omlish/lang/resources.py +18 -5
- omlish/sql/abc.py +13 -0
- {omlish-0.0.0.dev201.dist-info → omlish-0.0.0.dev202.dist-info}/METADATA +1 -1
- {omlish-0.0.0.dev201.dist-info → omlish-0.0.0.dev202.dist-info}/RECORD +11 -11
- {omlish-0.0.0.dev201.dist-info → omlish-0.0.0.dev202.dist-info}/LICENSE +0 -0
- {omlish-0.0.0.dev201.dist-info → omlish-0.0.0.dev202.dist-info}/WHEEL +0 -0
- {omlish-0.0.0.dev201.dist-info → omlish-0.0.0.dev202.dist-info}/entry_points.txt +0 -0
- {omlish-0.0.0.dev201.dist-info → omlish-0.0.0.dev202.dist-info}/top_level.txt +0 -0
omlish/__about__.py
CHANGED
omlish/formats/props.py
CHANGED
@@ -306,8 +306,7 @@ class Properties(collections.abc.MutableMapping):
|
|
306
306
|
if self._metadoc and self._prev_key:
|
307
307
|
prev_metadata = self._metadata.setdefault(self._prev_key, {})
|
308
308
|
prev_metadata.setdefault('_doc', '')
|
309
|
-
|
310
|
-
docstr = docstr[1:]
|
309
|
+
docstr = docstr.removeprefix(' ')
|
311
310
|
prev_metadata['_doc'] += docstr + '\n'
|
312
311
|
return
|
313
312
|
|
omlish/lang/__init__.py
CHANGED
omlish/lang/resources.py
CHANGED
@@ -6,7 +6,7 @@ import typing as ta
|
|
6
6
|
|
7
7
|
|
8
8
|
@dc.dataclass(frozen=True)
|
9
|
-
class
|
9
|
+
class ReadableResource:
|
10
10
|
name: str
|
11
11
|
is_file: bool
|
12
12
|
read_bytes: ta.Callable[[], bytes]
|
@@ -15,13 +15,26 @@ class RelativeResource:
|
|
15
15
|
return self.read_bytes().decode(encoding)
|
16
16
|
|
17
17
|
|
18
|
+
def get_package_resources(anchor: str) -> ta.Mapping[str, ReadableResource]:
|
19
|
+
lst: list[ReadableResource] = []
|
20
|
+
|
21
|
+
for pf in importlib.resources.files(anchor).iterdir():
|
22
|
+
lst.append(ReadableResource(
|
23
|
+
name=pf.name,
|
24
|
+
is_file=pf.is_file(),
|
25
|
+
read_bytes=pf.read_bytes if pf.is_file() else None, # type: ignore
|
26
|
+
))
|
27
|
+
|
28
|
+
return {r.name: r for r in lst}
|
29
|
+
|
30
|
+
|
18
31
|
def get_relative_resources(
|
19
32
|
path: str = '',
|
20
33
|
*,
|
21
34
|
globals: ta.Mapping[str, ta.Any] | None = None, # noqa
|
22
35
|
package: str | None = None,
|
23
36
|
file: str | None = None,
|
24
|
-
) -> ta.Mapping[str,
|
37
|
+
) -> ta.Mapping[str, ReadableResource]:
|
25
38
|
if globals is not None:
|
26
39
|
if not package:
|
27
40
|
package = globals.get('__package__')
|
@@ -45,7 +58,7 @@ def get_relative_resources(
|
|
45
58
|
|
46
59
|
#
|
47
60
|
|
48
|
-
lst: list[
|
61
|
+
lst: list[ReadableResource] = []
|
49
62
|
|
50
63
|
if package:
|
51
64
|
pkg_parts = package.split('.')
|
@@ -53,7 +66,7 @@ def get_relative_resources(
|
|
53
66
|
pkg_parts = pkg_parts[:-num_up]
|
54
67
|
anchor = '.'.join([*pkg_parts, *path_parts])
|
55
68
|
for pf in importlib.resources.files(anchor).iterdir():
|
56
|
-
lst.append(
|
69
|
+
lst.append(ReadableResource(
|
57
70
|
name=pf.name,
|
58
71
|
is_file=pf.is_file(),
|
59
72
|
read_bytes=pf.read_bytes if pf.is_file() else None, # type: ignore
|
@@ -73,7 +86,7 @@ def get_relative_resources(
|
|
73
86
|
|
74
87
|
for ff in os.listdir(dst_dir):
|
75
88
|
ff = os.path.join(dst_dir, ff)
|
76
|
-
lst.append(
|
89
|
+
lst.append(ReadableResource(
|
77
90
|
name=os.path.basename(ff),
|
78
91
|
is_file=os.path.isfile(ff),
|
79
92
|
read_bytes=functools.partial(_read_file, ff),
|
omlish/sql/abc.py
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
"""
|
2
|
+
https://peps.python.org/pep-0249/
|
3
|
+
"""
|
1
4
|
import typing as ta
|
2
5
|
|
3
6
|
|
@@ -14,6 +17,16 @@ DbapiColumnDescription: ta.TypeAlias = tuple[
|
|
14
17
|
]
|
15
18
|
|
16
19
|
|
20
|
+
class DbapiColumnDescription_(ta.NamedTuple): # noqa
|
21
|
+
name: str
|
22
|
+
type_code: DbapiTypeCode
|
23
|
+
display_size: int | None
|
24
|
+
internal_size: int | None
|
25
|
+
precision: int | None
|
26
|
+
scale: int | None
|
27
|
+
null_ok: bool | None
|
28
|
+
|
29
|
+
|
17
30
|
class DbapiConnection(ta.Protocol):
|
18
31
|
def close(self) -> object: ...
|
19
32
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
omlish/.manifests.json,sha256=dyIpveH7Z8OnQp2pTn6NVv7LCDXVrozJWAzbk8PBavg,7950
|
2
|
-
omlish/__about__.py,sha256=
|
2
|
+
omlish/__about__.py,sha256=TkrqZrE-0H4UPhtpzOoT1oElyBJWd2jFOEJucdouLTY,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
|
@@ -226,7 +226,7 @@ omlish/formats/codecs.py,sha256=ip4TLOyWAaUyEJmrIOzuLMtjRdgaMEsC6JeAlcCVi28,1657
|
|
226
226
|
omlish/formats/dotenv.py,sha256=qoDG4Ayu7B-8LjBBhcmNiLZW0_9LgCi3Ri2aPo9DEQ8,19314
|
227
227
|
omlish/formats/json5.py,sha256=odpZIShlUpv19aACWe58SoMPcv0AHKIa6zSMjlKgaMI,515
|
228
228
|
omlish/formats/pickle.py,sha256=jdp4E9WH9qVPBE3sSqbqDtUo18RbTSIiSpSzJ-IEVZw,529
|
229
|
-
omlish/formats/props.py,sha256=
|
229
|
+
omlish/formats/props.py,sha256=auCv-Jx79KGlWfyG1-Qo0ou-Ex0W_mF3r_lDFdsVkWI,18920
|
230
230
|
omlish/formats/repr.py,sha256=kYrNs4o-ji8nOdp6u_L3aMgBMWN1ZAZJSAWgQQfStSQ,414
|
231
231
|
omlish/formats/xml.py,sha256=ggiOwSERt4d9XmZwLZiDIh5qnFJS4jdmow9m9_9USps,1491
|
232
232
|
omlish/formats/yaml.py,sha256=ffOwGnLA6chdiFyaS7X0TBMGmHG9AoGudzKVWfQ1UOs,7389
|
@@ -357,7 +357,7 @@ omlish/iterators/iterators.py,sha256=ghI4dO6WPyyFOLTIIMaHQ_IOy2xXaFpGPqveZ5YGIBU
|
|
357
357
|
omlish/iterators/recipes.py,sha256=53mkexitMhkwXQZbL6DrhpT0WePQ_56uXd5Jaw3DfzI,467
|
358
358
|
omlish/iterators/tools.py,sha256=SvXyyQJh7aceLYhRl6pQB-rfSaXw5IMIWukeEeOZt-0,2492
|
359
359
|
omlish/iterators/unique.py,sha256=0jAX3kwzVfRNhe0Tmh7kVP_Q2WBIn8POo_O-rgFV0rQ,1390
|
360
|
-
omlish/lang/__init__.py,sha256=
|
360
|
+
omlish/lang/__init__.py,sha256=091aYd1gRii-ulxI9QAMjZBPLcl-kfL-XU82kLMR0qU,4013
|
361
361
|
omlish/lang/cached.py,sha256=92TvRZQ6sWlm7dNn4hgl7aWKbX0J1XUEo3DRjBpgVQk,7834
|
362
362
|
omlish/lang/clsdct.py,sha256=AjtIWLlx2E6D5rC97zQ3Lwq2SOMkbg08pdO_AxpzEHI,1744
|
363
363
|
omlish/lang/cmp.py,sha256=5vbzWWbqdzDmNKAGL19z6ZfUKe5Ci49e-Oegf9f4BsE,1346
|
@@ -372,7 +372,7 @@ omlish/lang/iterables.py,sha256=HOjcxOwyI5bBApDLsxRAGGhTTmw7fdZl2kEckxRVl-0,1994
|
|
372
372
|
omlish/lang/maybes.py,sha256=1RN7chX_x2XvgUwryZRz0W7hAX-be3eEFcFub5vvf6M,3417
|
373
373
|
omlish/lang/objects.py,sha256=LOC3JvX1g5hPxJ7Sv2TK9kNkAo9c8J-Jw2NmClR_rkA,4576
|
374
374
|
omlish/lang/resolving.py,sha256=OuN2mDTPNyBUbcrswtvFKtj4xgH4H4WglgqSKv3MTy0,1606
|
375
|
-
omlish/lang/resources.py,sha256=
|
375
|
+
omlish/lang/resources.py,sha256=N64KeVE-rYMxqBBRp91qzgVqpOVR2uX7k1WlS_bo5hM,2681
|
376
376
|
omlish/lang/strings.py,sha256=BsciSYnckD4vGtC6kmtnugR9IN6CIHdcjO4nZu-pSAw,3898
|
377
377
|
omlish/lang/sys.py,sha256=UoZz_PJYVKLQAKqYxxn-LHz1okK_38I__maZgnXMcxU,406
|
378
378
|
omlish/lang/timeouts.py,sha256=vECdWYhc_IZgcal1Ng1Y42wf2FV3KAx-i8As-MgGHIQ,1186
|
@@ -531,7 +531,7 @@ omlish/specs/openapi/__init__.py,sha256=zilQhafjvteRDF_TUIRgF293dBC6g-TJChmUb6T9
|
|
531
531
|
omlish/specs/openapi/marshal.py,sha256=Z-E2Knm04C81N8AA8cibCVSl2ImhSpHZVc7yAhmPx88,2135
|
532
532
|
omlish/specs/openapi/openapi.py,sha256=y4h04jeB7ORJSVrcy7apaBdpwLjIyscv1Ub5SderH2c,12682
|
533
533
|
omlish/sql/__init__.py,sha256=TpZLsEJKJzvJ0eMzuV8hwOJJbkxBCV1RZPUMLAVB6io,173
|
534
|
-
omlish/sql/abc.py,sha256=
|
534
|
+
omlish/sql/abc.py,sha256=NfbcIlEvdEu6vn0TolhfYb2SO5uzUmY0kARCbg6uVAU,1879
|
535
535
|
omlish/sql/dbapi.py,sha256=5ghJH-HexsmDlYdWlhf00nCGQX2IC98_gxIxMkucOas,3195
|
536
536
|
omlish/sql/dbs.py,sha256=lpdFmm2vTwLoBiVYGj9yPsVcTEYYNCxlYZZpjfChzkY,1870
|
537
537
|
omlish/sql/params.py,sha256=Z4VPet6GhNqD1T_MXSWSHkdy3cpUEhST-OplC4B_fYI,4433
|
@@ -609,9 +609,9 @@ omlish/text/indent.py,sha256=YjtJEBYWuk8--b9JU_T6q4yxV85_TR7VEVr5ViRCFwk,1336
|
|
609
609
|
omlish/text/minja.py,sha256=jZC-fp3Xuhx48ppqsf2Sf1pHbC0t8XBB7UpUUoOk2Qw,5751
|
610
610
|
omlish/text/parts.py,sha256=7vPF1aTZdvLVYJ4EwBZVzRSy8XB3YqPd7JwEnNGGAOo,6495
|
611
611
|
omlish/text/random.py,sha256=jNWpqiaKjKyTdMXC-pWAsSC10AAP-cmRRPVhm59ZWLk,194
|
612
|
-
omlish-0.0.0.
|
613
|
-
omlish-0.0.0.
|
614
|
-
omlish-0.0.0.
|
615
|
-
omlish-0.0.0.
|
616
|
-
omlish-0.0.0.
|
617
|
-
omlish-0.0.0.
|
612
|
+
omlish-0.0.0.dev202.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
613
|
+
omlish-0.0.0.dev202.dist-info/METADATA,sha256=XEiYKss22Lx_Cerj_g1QURXuSPir4iCoi-tiPex6nik,4264
|
614
|
+
omlish-0.0.0.dev202.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
615
|
+
omlish-0.0.0.dev202.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
|
616
|
+
omlish-0.0.0.dev202.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
|
617
|
+
omlish-0.0.0.dev202.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|