encommon 0.22.4__tar.gz → 0.22.5__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.
- {encommon-0.22.4/encommon.egg-info → encommon-0.22.5}/PKG-INFO +1 -1
- {encommon-0.22.4 → encommon-0.22.5}/encommon/utils/__init__.py +2 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/utils/files.py +39 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/utils/test/test_files.py +28 -0
- encommon-0.22.5/encommon/version.txt +1 -0
- {encommon-0.22.4 → encommon-0.22.5/encommon.egg-info}/PKG-INFO +1 -1
- encommon-0.22.4/encommon/version.txt +0 -1
- {encommon-0.22.4 → encommon-0.22.5}/LICENSE +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/MANIFEST.in +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/README.md +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/__init__.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/colors/__init__.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/colors/color.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/colors/test/__init__.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/colors/test/test_color.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/config/__init__.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/config/config.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/config/files.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/config/logger.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/config/params.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/config/paths.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/config/test/__init__.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/config/test/test_config.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/config/test/test_files.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/config/test/test_logger.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/config/test/test_paths.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/config/test/test_utils.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/config/utils.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/conftest.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/crypts/__init__.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/crypts/crypts.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/crypts/hashes.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/crypts/params.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/crypts/test/__init__.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/crypts/test/test_crypts.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/crypts/test/test_hashes.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/parse/__init__.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/parse/jinja2.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/parse/network.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/parse/test/__init__.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/parse/test/test_jinja2.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/parse/test/test_network.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/py.typed +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/__init__.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/common.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/duration.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/params.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/parse.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/test/__init__.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/test/test_duration.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/test/test_params.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/test/test_parse.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/test/test_time.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/test/test_timer.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/test/test_timers.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/test/test_unitime.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/test/test_utils.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/test/test_window.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/test/test_windows.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/time.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/timer.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/timers.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/unitime.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/utils.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/window.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/times/windows.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/types/__init__.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/types/classes.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/types/dicts.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/types/empty.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/types/funcs.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/types/lists.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/types/notate.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/types/strings.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/types/test/__init__.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/types/test/test_classes.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/types/test/test_dicts.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/types/test/test_empty.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/types/test/test_funcs.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/types/test/test_lists.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/types/test/test_notate.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/types/test/test_strings.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/types/types.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/utils/common.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/utils/match.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/utils/paths.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/utils/sample.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/utils/stdout.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/utils/test/__init__.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/utils/test/test_match.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/utils/test/test_paths.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/utils/test/test_sample.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/utils/test/test_stdout.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/__init__.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/content.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/images/enasis.svg +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/images/failure.svg +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/images/information.svg +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/images/success.svg +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/images/warning.svg +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/index.html +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/scripts/color.js +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/scripts/datagrid.js +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/scripts/datetime.js +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/scripts/default.js +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/scripts/duration.js +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/scripts/helpers.js +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/scripts/image.js +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/scripts/message.js +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/scripts/moderate.js +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/scripts/numeric.js +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/scripts/statate.js +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/scripts/tagues.js +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/styles/color.css +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/styles/datagrid.css +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/styles/datetime.css +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/styles/default.css +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/styles/duration.css +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/styles/image.css +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/styles/message.css +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/styles/moderate.css +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/styles/numeric.css +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/styles/statate.css +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/styles/tagues.css +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/test/__init__.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/test/conftest.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/test/test_color.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/test/test_content.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/test/test_datagrid.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/test/test_datetime.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/test/test_default.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/test/test_duration.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/test/test_helpers.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/test/test_image.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/test/test_message.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/test/test_moderate.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/test/test_numeric.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/test/test_statate.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon/webkit/test/test_tagues.py +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon.egg-info/SOURCES.txt +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon.egg-info/dependency_links.txt +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon.egg-info/requires.txt +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/encommon.egg-info/top_level.txt +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/pyproject.toml +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/require/install.txt +0 -0
- {encommon-0.22.4 → encommon-0.22.5}/setup.cfg +0 -0
@@ -7,6 +7,7 @@ is permitted, for more information consult the project license file.
|
|
7
7
|
|
8
8
|
|
9
9
|
|
10
|
+
from .files import append_text
|
10
11
|
from .files import read_text
|
11
12
|
from .files import save_text
|
12
13
|
from .match import fuzz_match
|
@@ -27,6 +28,7 @@ from .stdout import strip_ansi
|
|
27
28
|
|
28
29
|
|
29
30
|
__all__ = [
|
31
|
+
'append_text',
|
30
32
|
'array_ansi',
|
31
33
|
'fuzz_match',
|
32
34
|
'kvpair_ansi',
|
@@ -23,6 +23,8 @@ def read_text(
|
|
23
23
|
|
24
24
|
Example
|
25
25
|
-------
|
26
|
+
>>> path.exists()
|
27
|
+
False
|
26
28
|
>>> save_text(path, 'foo')
|
27
29
|
'foo'
|
28
30
|
>>> read_text(path)
|
@@ -52,6 +54,8 @@ def save_text(
|
|
52
54
|
|
53
55
|
Example
|
54
56
|
-------
|
57
|
+
>>> path.exists()
|
58
|
+
False
|
55
59
|
>>> save_text(path, 'foo')
|
56
60
|
'foo'
|
57
61
|
>>> read_text(path)
|
@@ -69,3 +73,38 @@ def save_text(
|
|
69
73
|
encoding='utf-8')
|
70
74
|
|
71
75
|
return read_text(path)
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
def append_text(
|
80
|
+
path: str | Path,
|
81
|
+
content: str,
|
82
|
+
) -> None:
|
83
|
+
"""
|
84
|
+
Append the provided text content into provided file path.
|
85
|
+
|
86
|
+
.. testsetup::
|
87
|
+
>>> tmpdir = getfixture('tmpdir')
|
88
|
+
>>> path = Path(f'{tmpdir}/text.txt')
|
89
|
+
|
90
|
+
Example
|
91
|
+
-------
|
92
|
+
>>> path.exists()
|
93
|
+
False
|
94
|
+
>>> append_text(path, 'foo')
|
95
|
+
>>> append_text(path, 'foo')
|
96
|
+
>>> read_text(path)
|
97
|
+
'foofoo'
|
98
|
+
|
99
|
+
:param path: Complete or relative path to the text file.
|
100
|
+
:param content: Content that will be written to the file.
|
101
|
+
"""
|
102
|
+
|
103
|
+
path = Path(path).resolve()
|
104
|
+
|
105
|
+
with path.open(
|
106
|
+
mode='a',
|
107
|
+
encoding='utf-8',
|
108
|
+
) as file:
|
109
|
+
|
110
|
+
file.write(f'{content}')
|
@@ -9,6 +9,7 @@ is permitted, for more information consult the project license file.
|
|
9
9
|
|
10
10
|
from pathlib import Path
|
11
11
|
|
12
|
+
from ..files import append_text
|
12
13
|
from ..files import read_text
|
13
14
|
from ..files import save_text
|
14
15
|
|
@@ -33,3 +34,30 @@ def test_readsave_text(
|
|
33
34
|
f'{tmp_path}/test.txt')
|
34
35
|
|
35
36
|
assert loaded == content
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
def test_append_text(
|
41
|
+
tmp_path: Path,
|
42
|
+
) -> None:
|
43
|
+
"""
|
44
|
+
Perform various tests associated with relevant routines.
|
45
|
+
|
46
|
+
:param tmp_path: pytest object for temporal filesystem.
|
47
|
+
"""
|
48
|
+
|
49
|
+
content = 'pytest'
|
50
|
+
|
51
|
+
append_text(
|
52
|
+
f'{tmp_path}/test.txt',
|
53
|
+
content)
|
54
|
+
|
55
|
+
append_text(
|
56
|
+
f'{tmp_path}/test.txt',
|
57
|
+
content)
|
58
|
+
|
59
|
+
loaded = read_text(
|
60
|
+
f'{tmp_path}/test.txt')
|
61
|
+
|
62
|
+
assert loaded == (
|
63
|
+
f'{content}{content}')
|
@@ -0,0 +1 @@
|
|
1
|
+
0.22.5
|
@@ -1 +0,0 @@
|
|
1
|
-
0.22.4
|
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
|
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
|