vcorelib 3.2.2__tar.gz → 3.2.4__tar.gz
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.
- {vcorelib-3.2.2/vcorelib.egg-info → vcorelib-3.2.4}/PKG-INFO +6 -6
- {vcorelib-3.2.2 → vcorelib-3.2.4}/README.md +2 -2
- {vcorelib-3.2.2 → vcorelib-3.2.4}/pyproject.toml +1 -1
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/__init__.py +2 -2
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/asyncio/__init__.py +12 -4
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/file_writer.py +9 -6
- {vcorelib-3.2.2 → vcorelib-3.2.4/vcorelib.egg-info}/PKG-INFO +6 -6
- {vcorelib-3.2.2 → vcorelib-3.2.4}/LICENSE +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/setup.cfg +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/setup.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/tests/test_names.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/tests/test_python.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/args/__init__.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/args/newline.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/asyncio/cli.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/asyncio/subprocess.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/dev_requirements.txt +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/dict/__init__.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/dict/cache.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/dict/codec.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/dict/config.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/dict/env.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/graph/__init__.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/graph/abc.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/graph/edge.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/graph/node.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/graph/port.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/__init__.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/abc.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/arbiter/__init__.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/arbiter/base.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/arbiter/context.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/arbiter/directory.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/archive/__init__.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/cache.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/decode.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/encode.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/fifo.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/mapping.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/io/types.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/logging/__init__.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/logging/args.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/logging/time.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/math/__init__.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/math/analysis/__init__.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/math/analysis/average.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/math/analysis/buffer.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/math/analysis/rate/__init__.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/math/analysis/rate/limiter.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/math/analysis/weighted.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/math/constants.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/math/time.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/math/unit.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/names.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/namespace/__init__.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/namespace/base.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/namespace/mixin.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/paths/__init__.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/paths/base.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/paths/context.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/paths/find.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/paths/hashing.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/paths/info.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/paths/info_cache.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/platform/__init__.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/py.typed +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/python.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/requirements.txt +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/schemas/__init__.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/schemas/base.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/schemas/json.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/schemas/mixins.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/script/__init__.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/target/__init__.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/target/evaluation.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/target/expression.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/target/resolver.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/task/__init__.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/task/dict/__init__.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/task/dict/melder.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/task/manager.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/task/subprocess/__init__.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/task/subprocess/run.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/task/time/__init__.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib/task/time/sleep.py +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib.egg-info/SOURCES.txt +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib.egg-info/dependency_links.txt +0 -0
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib.egg-info/requires.txt +3 -3
- {vcorelib-3.2.2 → vcorelib-3.2.4}/vcorelib.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: vcorelib
|
|
3
|
-
Version: 3.2.
|
|
3
|
+
Version: 3.2.4
|
|
4
4
|
Summary: A collection of core Python utilities.
|
|
5
5
|
Home-page: https://github.com/vkottler/vcorelib
|
|
6
6
|
Author: Vaughn Kottler
|
|
@@ -17,11 +17,11 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
17
17
|
Requires-Python: >=3.11
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
|
-
Requires-Dist:
|
|
21
|
-
Requires-Dist: tomli-w
|
|
20
|
+
Requires-Dist: tomli
|
|
22
21
|
Requires-Dist: cerberus
|
|
23
22
|
Requires-Dist: fastjsonschema
|
|
24
|
-
Requires-Dist:
|
|
23
|
+
Requires-Dist: ruamel.yaml
|
|
24
|
+
Requires-Dist: tomli-w
|
|
25
25
|
Requires-Dist: importlib-resources
|
|
26
26
|
Provides-Extra: test
|
|
27
27
|
Requires-Dist: pylint; extra == "test"
|
|
@@ -44,11 +44,11 @@ Requires-Dist: uvloop; (sys_platform != "win32" and sys_platform != "cygwin") an
|
|
|
44
44
|
=====================================
|
|
45
45
|
generator=datazen
|
|
46
46
|
version=3.1.4
|
|
47
|
-
hash=
|
|
47
|
+
hash=bc0b27e02d365bc98f792016fb5c40a1
|
|
48
48
|
=====================================
|
|
49
49
|
-->
|
|
50
50
|
|
|
51
|
-
# vcorelib ([3.2.
|
|
51
|
+
# vcorelib ([3.2.4](https://pypi.org/project/vcorelib/))
|
|
52
52
|
|
|
53
53
|
[](https://pypi.org/project/vcorelib/)
|
|
54
54
|

|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
=====================================
|
|
3
3
|
generator=datazen
|
|
4
4
|
version=3.1.4
|
|
5
|
-
hash=
|
|
5
|
+
hash=bc0b27e02d365bc98f792016fb5c40a1
|
|
6
6
|
=====================================
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
|
-
# vcorelib ([3.2.
|
|
9
|
+
# vcorelib ([3.2.4](https://pypi.org/project/vcorelib/))
|
|
10
10
|
|
|
11
11
|
[](https://pypi.org/project/vcorelib/)
|
|
12
12
|

|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# =====================================
|
|
2
2
|
# generator=datazen
|
|
3
3
|
# version=3.1.4
|
|
4
|
-
# hash=
|
|
4
|
+
# hash=72f33cb7eb34d1a8b0e94f5741c13762
|
|
5
5
|
# =====================================
|
|
6
6
|
|
|
7
7
|
"""
|
|
@@ -10,7 +10,7 @@ Useful defaults and other package metadata.
|
|
|
10
10
|
|
|
11
11
|
DESCRIPTION = "A collection of core Python utilities."
|
|
12
12
|
PKG_NAME = "vcorelib"
|
|
13
|
-
VERSION = "3.2.
|
|
13
|
+
VERSION = "3.2.4"
|
|
14
14
|
|
|
15
15
|
# vcorelib-specific content.
|
|
16
16
|
DEFAULT_INDENT = 2
|
|
@@ -58,6 +58,15 @@ def log_exceptions(
|
|
|
58
58
|
return [x for x in tasks if not x.done()]
|
|
59
59
|
|
|
60
60
|
|
|
61
|
+
def new_eloop(set_current: bool = True) -> _asyncio.AbstractEventLoop:
|
|
62
|
+
"""Get a new event loop."""
|
|
63
|
+
|
|
64
|
+
eloop = _asyncio.new_event_loop()
|
|
65
|
+
if set_current:
|
|
66
|
+
_asyncio.set_event_loop(eloop)
|
|
67
|
+
return eloop
|
|
68
|
+
|
|
69
|
+
|
|
61
70
|
def normalize_eloop(
|
|
62
71
|
eloop: _asyncio.AbstractEventLoop = None,
|
|
63
72
|
) -> _asyncio.AbstractEventLoop:
|
|
@@ -67,8 +76,7 @@ def normalize_eloop(
|
|
|
67
76
|
try:
|
|
68
77
|
eloop = _asyncio.get_running_loop()
|
|
69
78
|
except RuntimeError:
|
|
70
|
-
eloop =
|
|
71
|
-
_asyncio.set_event_loop(eloop)
|
|
79
|
+
eloop = new_eloop()
|
|
72
80
|
return eloop
|
|
73
81
|
|
|
74
82
|
|
|
@@ -93,10 +101,10 @@ def shutdown_loop(
|
|
|
93
101
|
|
|
94
102
|
|
|
95
103
|
def run_handle_interrupt(
|
|
96
|
-
to_run: _Awaitable[
|
|
104
|
+
to_run: _Awaitable[T],
|
|
97
105
|
eloop: _asyncio.AbstractEventLoop = None,
|
|
98
106
|
enable_uvloop: bool = True,
|
|
99
|
-
) -> _Optional[
|
|
107
|
+
) -> _Optional[T]:
|
|
100
108
|
"""
|
|
101
109
|
Run a task in an event loop and gracefully handle keyboard interrupts.
|
|
102
110
|
|
|
@@ -6,7 +6,7 @@ A module implementing an interface for writing to variably indented files.
|
|
|
6
6
|
from contextlib import contextmanager
|
|
7
7
|
from enum import Enum, auto
|
|
8
8
|
from io import StringIO
|
|
9
|
-
|
|
9
|
+
import os
|
|
10
10
|
from pathlib import Path
|
|
11
11
|
from typing import Iterator, List, Optional, TextIO, Tuple
|
|
12
12
|
|
|
@@ -49,6 +49,7 @@ class IndentedFileWriter:
|
|
|
49
49
|
per_indent: int = 1,
|
|
50
50
|
prefix: str = "",
|
|
51
51
|
suffix: str = "",
|
|
52
|
+
linesep: str = os.linesep,
|
|
52
53
|
) -> None:
|
|
53
54
|
"""Initialize this instance."""
|
|
54
55
|
|
|
@@ -61,6 +62,8 @@ class IndentedFileWriter:
|
|
|
61
62
|
self._prefix = prefix
|
|
62
63
|
self._suffix = suffix
|
|
63
64
|
|
|
65
|
+
self.linesep = linesep
|
|
66
|
+
|
|
64
67
|
@contextmanager
|
|
65
68
|
def prefix(self, prefix: str) -> Iterator[None]:
|
|
66
69
|
"""Set a new line prefix as a managed context."""
|
|
@@ -93,13 +96,13 @@ class IndentedFileWriter:
|
|
|
93
96
|
@staticmethod
|
|
94
97
|
@contextmanager
|
|
95
98
|
def from_path(
|
|
96
|
-
path: Path, space: str = " ", per_indent: int = 1
|
|
99
|
+
path: Path, space: str = " ", per_indent: int = 1, **kwargs
|
|
97
100
|
) -> Iterator["IndentedFileWriter"]:
|
|
98
101
|
"""Create an instance from a path as a managed context."""
|
|
99
102
|
|
|
100
103
|
with path.open("w", encoding=DEFAULT_ENCODING) as stream:
|
|
101
104
|
yield IndentedFileWriter(
|
|
102
|
-
stream, space=space, per_indent=per_indent
|
|
105
|
+
stream, space=space, per_indent=per_indent, **kwargs
|
|
103
106
|
)
|
|
104
107
|
|
|
105
108
|
@staticmethod
|
|
@@ -117,13 +120,13 @@ class IndentedFileWriter:
|
|
|
117
120
|
@staticmethod
|
|
118
121
|
@contextmanager
|
|
119
122
|
def temporary(
|
|
120
|
-
space: str = " ", per_indent: int = 1
|
|
123
|
+
space: str = " ", per_indent: int = 1, **kwargs
|
|
121
124
|
) -> Iterator["IndentedFileWriter"]:
|
|
122
125
|
"""Create an instance from a temporary file as a managed context."""
|
|
123
126
|
|
|
124
127
|
with tempfile() as tmp:
|
|
125
128
|
with IndentedFileWriter.from_path(
|
|
126
|
-
tmp, space=space, per_indent=per_indent
|
|
129
|
+
tmp, space=space, per_indent=per_indent, **kwargs
|
|
127
130
|
) as writer:
|
|
128
131
|
yield writer
|
|
129
132
|
|
|
@@ -144,7 +147,7 @@ class IndentedFileWriter:
|
|
|
144
147
|
self.space * self.depth * self.per_indent if line_data else ""
|
|
145
148
|
)
|
|
146
149
|
|
|
147
|
-
line = (indent + line_data).rstrip() + linesep
|
|
150
|
+
line = (indent + line_data).rstrip() + self.linesep
|
|
148
151
|
|
|
149
152
|
self.stream.write(line)
|
|
150
153
|
count += len(line)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: vcorelib
|
|
3
|
-
Version: 3.2.
|
|
3
|
+
Version: 3.2.4
|
|
4
4
|
Summary: A collection of core Python utilities.
|
|
5
5
|
Home-page: https://github.com/vkottler/vcorelib
|
|
6
6
|
Author: Vaughn Kottler
|
|
@@ -17,11 +17,11 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
17
17
|
Requires-Python: >=3.11
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
|
-
Requires-Dist:
|
|
21
|
-
Requires-Dist: tomli-w
|
|
20
|
+
Requires-Dist: tomli
|
|
22
21
|
Requires-Dist: cerberus
|
|
23
22
|
Requires-Dist: fastjsonschema
|
|
24
|
-
Requires-Dist:
|
|
23
|
+
Requires-Dist: ruamel.yaml
|
|
24
|
+
Requires-Dist: tomli-w
|
|
25
25
|
Requires-Dist: importlib-resources
|
|
26
26
|
Provides-Extra: test
|
|
27
27
|
Requires-Dist: pylint; extra == "test"
|
|
@@ -44,11 +44,11 @@ Requires-Dist: uvloop; (sys_platform != "win32" and sys_platform != "cygwin") an
|
|
|
44
44
|
=====================================
|
|
45
45
|
generator=datazen
|
|
46
46
|
version=3.1.4
|
|
47
|
-
hash=
|
|
47
|
+
hash=bc0b27e02d365bc98f792016fb5c40a1
|
|
48
48
|
=====================================
|
|
49
49
|
-->
|
|
50
50
|
|
|
51
|
-
# vcorelib ([3.2.
|
|
51
|
+
# vcorelib ([3.2.4](https://pypi.org/project/vcorelib/))
|
|
52
52
|
|
|
53
53
|
[](https://pypi.org/project/vcorelib/)
|
|
54
54
|

|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|