encommon 0.22.3__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.3/encommon.egg-info → encommon-0.22.5}/PKG-INFO +1 -1
- {encommon-0.22.3 → encommon-0.22.5}/encommon/colors/color.py +2 -2
- {encommon-0.22.3 → encommon-0.22.5}/encommon/parse/network.py +2 -2
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/duration.py +2 -2
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/time.py +2 -2
- {encommon-0.22.3 → encommon-0.22.5}/encommon/types/__init__.py +2 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/types/empty.py +2 -2
- encommon-0.22.5/encommon/types/funcs.py +53 -0
- encommon-0.22.5/encommon/types/test/test_funcs.py +33 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/utils/__init__.py +2 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/utils/files.py +39 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/utils/test/test_files.py +28 -0
- encommon-0.22.5/encommon/version.txt +1 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/scripts/color.js +5 -1
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/scripts/datagrid.js +15 -3
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/scripts/datetime.js +8 -2
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/scripts/default.js +76 -15
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/scripts/duration.js +8 -2
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/scripts/helpers.js +79 -17
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/scripts/image.js +5 -1
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/scripts/message.js +5 -1
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/scripts/moderate.js +5 -1
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/scripts/numeric.js +25 -5
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/scripts/statate.js +5 -1
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/scripts/tagues.js +5 -1
- {encommon-0.22.3 → encommon-0.22.5/encommon.egg-info}/PKG-INFO +1 -1
- {encommon-0.22.3 → encommon-0.22.5}/encommon.egg-info/SOURCES.txt +2 -0
- encommon-0.22.3/encommon/version.txt +0 -1
- {encommon-0.22.3 → encommon-0.22.5}/LICENSE +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/MANIFEST.in +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/README.md +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/__init__.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/colors/__init__.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/colors/test/__init__.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/colors/test/test_color.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/config/__init__.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/config/config.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/config/files.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/config/logger.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/config/params.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/config/paths.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/config/test/__init__.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/config/test/test_config.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/config/test/test_files.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/config/test/test_logger.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/config/test/test_paths.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/config/test/test_utils.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/config/utils.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/conftest.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/crypts/__init__.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/crypts/crypts.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/crypts/hashes.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/crypts/params.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/crypts/test/__init__.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/crypts/test/test_crypts.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/crypts/test/test_hashes.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/parse/__init__.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/parse/jinja2.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/parse/test/__init__.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/parse/test/test_jinja2.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/parse/test/test_network.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/py.typed +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/__init__.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/common.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/params.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/parse.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/test/__init__.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/test/test_duration.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/test/test_params.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/test/test_parse.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/test/test_time.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/test/test_timer.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/test/test_timers.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/test/test_unitime.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/test/test_utils.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/test/test_window.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/test/test_windows.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/timer.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/timers.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/unitime.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/utils.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/window.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/times/windows.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/types/classes.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/types/dicts.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/types/lists.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/types/notate.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/types/strings.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/types/test/__init__.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/types/test/test_classes.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/types/test/test_dicts.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/types/test/test_empty.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/types/test/test_lists.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/types/test/test_notate.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/types/test/test_strings.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/types/types.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/utils/common.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/utils/match.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/utils/paths.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/utils/sample.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/utils/stdout.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/utils/test/__init__.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/utils/test/test_match.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/utils/test/test_paths.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/utils/test/test_sample.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/utils/test/test_stdout.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/__init__.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/content.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/images/enasis.svg +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/images/failure.svg +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/images/information.svg +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/images/success.svg +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/images/warning.svg +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/index.html +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/styles/color.css +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/styles/datagrid.css +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/styles/datetime.css +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/styles/default.css +3 -3
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/styles/duration.css +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/styles/image.css +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/styles/message.css +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/styles/moderate.css +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/styles/numeric.css +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/styles/statate.css +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/styles/tagues.css +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/test/__init__.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/test/conftest.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/test/test_color.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/test/test_content.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/test/test_datagrid.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/test/test_datetime.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/test/test_default.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/test/test_duration.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/test/test_helpers.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/test/test_image.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/test/test_message.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/test/test_moderate.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/test/test_numeric.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/test/test_statate.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon/webkit/test/test_tagues.py +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon.egg-info/dependency_links.txt +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon.egg-info/requires.txt +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/encommon.egg-info/top_level.txt +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/pyproject.toml +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/require/install.txt +0 -0
- {encommon-0.22.3 → encommon-0.22.5}/setup.cfg +0 -0
@@ -79,9 +79,9 @@ class Color:
|
|
79
79
|
self,
|
80
80
|
) -> int:
|
81
81
|
"""
|
82
|
-
Built-in method
|
82
|
+
Built-in method used when performing hashing operations.
|
83
83
|
|
84
|
-
:returns:
|
84
|
+
:returns: Integer hash value for the internal reference.
|
85
85
|
"""
|
86
86
|
|
87
87
|
return hash(self.__source)
|
@@ -55,9 +55,9 @@ class Network:
|
|
55
55
|
self,
|
56
56
|
) -> int:
|
57
57
|
"""
|
58
|
-
Built-in method
|
58
|
+
Built-in method used when performing hashing operations.
|
59
59
|
|
60
|
-
:returns:
|
60
|
+
:returns: Integer hash value for the internal reference.
|
61
61
|
"""
|
62
62
|
|
63
63
|
return hash(self.__source)
|
@@ -132,9 +132,9 @@ class Duration:
|
|
132
132
|
self,
|
133
133
|
) -> int:
|
134
134
|
"""
|
135
|
-
Built-in method
|
135
|
+
Built-in method used when performing hashing operations.
|
136
136
|
|
137
|
-
:returns:
|
137
|
+
:returns: Integer hash value for the internal reference.
|
138
138
|
"""
|
139
139
|
|
140
140
|
return hash(self.__source)
|
@@ -129,9 +129,9 @@ class Time:
|
|
129
129
|
self,
|
130
130
|
) -> int:
|
131
131
|
"""
|
132
|
-
Built-in method
|
132
|
+
Built-in method used when performing hashing operations.
|
133
133
|
|
134
|
-
:returns:
|
134
|
+
:returns: Integer hash value for the internal reference.
|
135
135
|
"""
|
136
136
|
|
137
137
|
return hash(self.__source)
|
@@ -13,6 +13,7 @@ from .classes import lattrs
|
|
13
13
|
from .dicts import merge_dicts
|
14
14
|
from .dicts import sort_dict
|
15
15
|
from .empty import Empty
|
16
|
+
from .funcs import funcname
|
16
17
|
from .lists import dedup_list
|
17
18
|
from .lists import fuzzy_list
|
18
19
|
from .lists import inlist
|
@@ -42,6 +43,7 @@ __all__ = [
|
|
42
43
|
'DictStrAny',
|
43
44
|
'Empty',
|
44
45
|
'expate',
|
46
|
+
'funcname',
|
45
47
|
'getate',
|
46
48
|
'hasstr',
|
47
49
|
'impate',
|
@@ -78,9 +78,9 @@ class EmptyType:
|
|
78
78
|
self,
|
79
79
|
) -> int:
|
80
80
|
"""
|
81
|
-
Built-in method
|
81
|
+
Built-in method used when performing hashing operations.
|
82
82
|
|
83
|
-
:returns:
|
83
|
+
:returns: Integer hash value for the internal reference.
|
84
84
|
"""
|
85
85
|
|
86
86
|
return hash(EmptyType)
|
@@ -0,0 +1,53 @@
|
|
1
|
+
"""
|
2
|
+
Functions and routines associated with Enasis Network Common Library.
|
3
|
+
|
4
|
+
This file is part of Enasis Network software eco-system. Distribution
|
5
|
+
is permitted, for more information consult the project license file.
|
6
|
+
"""
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
from inspect import currentframe
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
def funcname() -> str:
|
15
|
+
"""
|
16
|
+
Return the current function name where code is running.
|
17
|
+
|
18
|
+
:returns: Current function name where code is running.
|
19
|
+
"""
|
20
|
+
|
21
|
+
frame = currentframe()
|
22
|
+
|
23
|
+
assert frame is not None, (
|
24
|
+
'Frame not present')
|
25
|
+
|
26
|
+
caller = frame.f_back
|
27
|
+
|
28
|
+
assert caller is not None, (
|
29
|
+
'Caller not present')
|
30
|
+
|
31
|
+
name = caller.f_code.co_name
|
32
|
+
focals = caller.f_locals
|
33
|
+
|
34
|
+
|
35
|
+
if 'self' in focals:
|
36
|
+
|
37
|
+
parent = (
|
38
|
+
focals['self']
|
39
|
+
.__class__
|
40
|
+
.__name__)
|
41
|
+
|
42
|
+
return f'{parent}.{name}'
|
43
|
+
|
44
|
+
elif 'cls' in focals:
|
45
|
+
|
46
|
+
parent = (
|
47
|
+
focals['cls']
|
48
|
+
.__name__)
|
49
|
+
|
50
|
+
return f'{parent}.{name}'
|
51
|
+
|
52
|
+
|
53
|
+
return name
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"""
|
2
|
+
Functions and routines associated with Enasis Network Common Library.
|
3
|
+
|
4
|
+
This file is part of Enasis Network software eco-system. Distribution
|
5
|
+
is permitted, for more information consult the project license file.
|
6
|
+
"""
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
from ..funcs import funcname
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
def test_funcname() -> None:
|
15
|
+
"""
|
16
|
+
Perform various tests associated with relevant routines.
|
17
|
+
"""
|
18
|
+
|
19
|
+
assert funcname() == 'test_funcname'
|
20
|
+
|
21
|
+
|
22
|
+
class Testing:
|
23
|
+
|
24
|
+
def test1(self) -> str:
|
25
|
+
return funcname()
|
26
|
+
|
27
|
+
@classmethod
|
28
|
+
def test2(cls) -> str:
|
29
|
+
return funcname()
|
30
|
+
|
31
|
+
|
32
|
+
assert Testing().test1() == 'Testing.test1'
|
33
|
+
assert Testing.test2() == 'Testing.test2'
|
@@ -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
|
@@ -7,11 +7,15 @@ is permitted, for more information consult the project license file.
|
|
7
7
|
|
8
8
|
|
9
9
|
|
10
|
+
/**
|
11
|
+
* Construct element for displaying the specified color.
|
12
|
+
*
|
13
|
+
* @returns {Object} jQuery-like object for the element.
|
14
|
+
*/
|
10
15
|
function colordiv(
|
11
16
|
input,
|
12
17
|
label=null,
|
13
18
|
) {
|
14
|
-
// Construct element for displaying the specified color.
|
15
19
|
|
16
20
|
assert(!isnull(input));
|
17
21
|
|
@@ -7,11 +7,15 @@ is permitted, for more information consult the project license file.
|
|
7
7
|
|
8
8
|
|
9
9
|
|
10
|
+
/**
|
11
|
+
* Construct the table with the header using the contents.
|
12
|
+
*
|
13
|
+
* @returns {Object} jQuery-like object for the element.
|
14
|
+
*/
|
10
15
|
function datagrid(
|
11
16
|
fields,
|
12
17
|
values,
|
13
18
|
) {
|
14
|
-
// Construct the table with the header using the contents.
|
15
19
|
|
16
20
|
assert(!isnull(fields));
|
17
21
|
assert(!isnull(values));
|
@@ -34,10 +38,14 @@ function datagrid(
|
|
34
38
|
|
35
39
|
|
36
40
|
|
41
|
+
/**
|
42
|
+
* Construct the header for use with the table contents.
|
43
|
+
*
|
44
|
+
* @returns {Object} jQuery-like object for the element.
|
45
|
+
*/
|
37
46
|
function _table_header(
|
38
47
|
fields,
|
39
48
|
) {
|
40
|
-
// Construct the header for use with the table contents.
|
41
49
|
|
42
50
|
let element = $('<thead/>');
|
43
51
|
let trow = $('<tr/>');
|
@@ -63,11 +71,15 @@ function _table_header(
|
|
63
71
|
|
64
72
|
|
65
73
|
|
74
|
+
/**
|
75
|
+
* Construct the records for use with the table contents.
|
76
|
+
*
|
77
|
+
* @returns {Object} jQuery-like object for the element.
|
78
|
+
*/
|
66
79
|
function _table_records(
|
67
80
|
fields,
|
68
81
|
values,
|
69
82
|
) {
|
70
|
-
// Construct the records for use with the table contents.
|
71
83
|
|
72
84
|
let element = $('<tbody/>');
|
73
85
|
|
@@ -7,10 +7,14 @@ is permitted, for more information consult the project license file.
|
|
7
7
|
|
8
8
|
|
9
9
|
|
10
|
+
/**
|
11
|
+
* Return the timestamp using provided format for instance.
|
12
|
+
*
|
13
|
+
* @returns {Object} jQuery-like object for the element.
|
14
|
+
*/
|
10
15
|
function datestamp(
|
11
16
|
value,
|
12
17
|
) {
|
13
|
-
// Return the timestamp using provided format for instance.
|
14
18
|
|
15
19
|
assert(!isnull(value));
|
16
20
|
|
@@ -140,10 +144,12 @@ function datestamp(
|
|
140
144
|
|
141
145
|
|
142
146
|
|
147
|
+
/**
|
148
|
+
* Return the located timezone object for the provided date.
|
149
|
+
*/
|
143
150
|
function _tzname(
|
144
151
|
date,
|
145
152
|
) {
|
146
|
-
// Return the located timezone object for the provided date.
|
147
153
|
|
148
154
|
assert(!isnull(date));
|
149
155
|
|
@@ -7,8 +7,10 @@ is permitted, for more information consult the project license file.
|
|
7
7
|
|
8
8
|
|
9
9
|
|
10
|
+
/**
|
11
|
+
* jQuery like object for use in Enasis Network projects.
|
12
|
+
*/
|
10
13
|
(function (global) {
|
11
|
-
// jQuery like object for use in Enasis Network projects.
|
12
14
|
|
13
15
|
'use strict';
|
14
16
|
|
@@ -98,11 +100,13 @@ is permitted, for more information consult the project license file.
|
|
98
100
|
|
99
101
|
|
100
102
|
|
103
|
+
/**
|
104
|
+
* Helper function for Enasis Network jQuery replacement.
|
105
|
+
*/
|
101
106
|
function _enquery(
|
102
107
|
source,
|
103
108
|
selector,
|
104
109
|
) {
|
105
|
-
// Helper function for Enasis Network jQuery replacement.
|
106
110
|
|
107
111
|
const create = /^<(\w+)\/>$/;
|
108
112
|
|
@@ -127,10 +131,14 @@ function _enquery(
|
|
127
131
|
|
128
132
|
|
129
133
|
|
134
|
+
/**
|
135
|
+
* Helper function for Enasis Network jQuery replacement.
|
136
|
+
*
|
137
|
+
* @returns {Object} jQuery-like object for the element.
|
138
|
+
*/
|
130
139
|
function _enquery_each(
|
131
140
|
element,
|
132
141
|
) {
|
133
|
-
// Helper function for Enasis Network jQuery replacement.
|
134
142
|
|
135
143
|
let items = this.elements;
|
136
144
|
|
@@ -142,11 +150,15 @@ function _enquery_each(
|
|
142
150
|
|
143
151
|
|
144
152
|
|
153
|
+
/**
|
154
|
+
* Helper function for Enasis Network jQuery replacement.
|
155
|
+
*
|
156
|
+
* @returns {Object} jQuery-like object for the element.
|
157
|
+
*/
|
145
158
|
function _enquery_css(
|
146
159
|
name,
|
147
160
|
value,
|
148
161
|
) {
|
149
|
-
// Helper function for Enasis Network jQuery replacement.
|
150
162
|
|
151
163
|
function _each() {
|
152
164
|
this.style[name] = value; }
|
@@ -155,10 +167,14 @@ function _enquery_css(
|
|
155
167
|
|
156
168
|
|
157
169
|
|
170
|
+
/**
|
171
|
+
* Helper function for Enasis Network jQuery replacement.
|
172
|
+
*
|
173
|
+
* @returns {Object} jQuery-like object for the element.
|
174
|
+
*/
|
158
175
|
function _enquery_addcls(
|
159
176
|
name,
|
160
177
|
) {
|
161
|
-
// Helper function for Enasis Network jQuery replacement.
|
162
178
|
|
163
179
|
function _each() {
|
164
180
|
this.classList
|
@@ -168,10 +184,14 @@ function _enquery_addcls(
|
|
168
184
|
|
169
185
|
|
170
186
|
|
187
|
+
/**
|
188
|
+
* Helper function for Enasis Network jQuery replacement.
|
189
|
+
*
|
190
|
+
* @returns {Object} jQuery-like object for the element.
|
191
|
+
*/
|
171
192
|
function _enquery_remcls(
|
172
193
|
name,
|
173
194
|
) {
|
174
|
-
// Helper function for Enasis Network jQuery replacement.
|
175
195
|
|
176
196
|
function _each() {
|
177
197
|
this.classList
|
@@ -181,8 +201,12 @@ function _enquery_remcls(
|
|
181
201
|
|
182
202
|
|
183
203
|
|
204
|
+
/**
|
205
|
+
* Helper function for Enasis Network jQuery replacement.
|
206
|
+
*
|
207
|
+
* @returns {Object} jQuery-like object for the element.
|
208
|
+
*/
|
184
209
|
function _enquery_hide() {
|
185
|
-
// Helper function for Enasis Network jQuery replacement.
|
186
210
|
|
187
211
|
|
188
212
|
function _each() {
|
@@ -204,8 +228,12 @@ function _enquery_hide() {
|
|
204
228
|
|
205
229
|
|
206
230
|
|
231
|
+
/**
|
232
|
+
* Helper function for Enasis Network jQuery replacement.
|
233
|
+
*
|
234
|
+
* @returns {Object} jQuery-like object for the element.
|
235
|
+
*/
|
207
236
|
function _enquery_show() {
|
208
|
-
// Helper function for Enasis Network jQuery replacement.
|
209
237
|
|
210
238
|
|
211
239
|
function _each() {
|
@@ -232,10 +260,15 @@ function _enquery_show() {
|
|
232
260
|
|
233
261
|
|
234
262
|
|
263
|
+
/**
|
264
|
+
* Helper function for Enasis Network jQuery replacement.
|
265
|
+
*
|
266
|
+
* @returns {Object} jQuery-like object for the element
|
267
|
+
* or the text value in first element.
|
268
|
+
*/
|
235
269
|
function _enquery_text(
|
236
270
|
text,
|
237
271
|
) {
|
238
|
-
// Helper function for Enasis Network jQuery replacement.
|
239
272
|
|
240
273
|
if (text === undefined) {
|
241
274
|
|
@@ -253,10 +286,15 @@ function _enquery_text(
|
|
253
286
|
|
254
287
|
|
255
288
|
|
289
|
+
/**
|
290
|
+
* Helper function for Enasis Network jQuery replacement.
|
291
|
+
*
|
292
|
+
* @returns {Object} jQuery-like object for the element
|
293
|
+
* or the HTML value in first element.
|
294
|
+
*/
|
256
295
|
function _enquery_html(
|
257
296
|
html,
|
258
297
|
) {
|
259
|
-
// Helper function for Enasis Network jQuery replacement.
|
260
298
|
|
261
299
|
if (html === undefined) {
|
262
300
|
|
@@ -280,10 +318,14 @@ function _enquery_html(
|
|
280
318
|
|
281
319
|
|
282
320
|
|
321
|
+
/**
|
322
|
+
* Helper function for Enasis Network jQuery replacement.
|
323
|
+
*
|
324
|
+
* @returns {Object} jQuery-like object for the element.
|
325
|
+
*/
|
283
326
|
function _enquery_append(
|
284
327
|
element,
|
285
328
|
) {
|
286
|
-
// Helper function for Enasis Network jQuery replacement.
|
287
329
|
|
288
330
|
assert(element.enquery)
|
289
331
|
|
@@ -305,10 +347,14 @@ function _enquery_append(
|
|
305
347
|
|
306
348
|
|
307
349
|
|
350
|
+
/**
|
351
|
+
* Helper function for Enasis Network jQuery replacement.
|
352
|
+
*
|
353
|
+
* @returns {Object} jQuery-like object for the element.
|
354
|
+
*/
|
308
355
|
function _enquery_replace(
|
309
356
|
element,
|
310
357
|
) {
|
311
|
-
// Helper function for Enasis Network jQuery replacement.
|
312
358
|
|
313
359
|
assert(element.enquery)
|
314
360
|
|
@@ -330,11 +376,16 @@ function _enquery_replace(
|
|
330
376
|
|
331
377
|
|
332
378
|
|
379
|
+
/**
|
380
|
+
* Helper function for Enasis Network jQuery replacement.
|
381
|
+
*
|
382
|
+
* @returns {Object} jQuery-like object for the element
|
383
|
+
* or the attr value in first element.
|
384
|
+
*/
|
333
385
|
function _enquery_attr(
|
334
386
|
name,
|
335
387
|
value,
|
336
388
|
) {
|
337
|
-
// Helper function for Enasis Network jQuery replacement.
|
338
389
|
|
339
390
|
if (this.length === 0)
|
340
391
|
return undefined;
|
@@ -359,11 +410,16 @@ function _enquery_attr(
|
|
359
410
|
|
360
411
|
|
361
412
|
|
413
|
+
/**
|
414
|
+
* Helper function for Enasis Network jQuery replacement.
|
415
|
+
*
|
416
|
+
* @returns {Object} jQuery-like object for the element
|
417
|
+
* or the prop value in first element.
|
418
|
+
*/
|
362
419
|
function _enquery_prop(
|
363
420
|
name,
|
364
421
|
value,
|
365
422
|
) {
|
366
|
-
// Helper function for Enasis Network jQuery replacement.
|
367
423
|
|
368
424
|
if (this.length === 0)
|
369
425
|
return undefined;
|
@@ -376,13 +432,18 @@ function _enquery_prop(
|
|
376
432
|
this[name] = value; }
|
377
433
|
|
378
434
|
if (value !== undefined)
|
379
|
-
|
435
|
+
return this.each(_each);
|
380
436
|
|
381
437
|
|
382
438
|
return this[0][name]; }
|
383
439
|
|
384
440
|
|
385
441
|
|
442
|
+
/**
|
443
|
+
* Helper function for Enasis Network jQuery replacement.
|
444
|
+
*
|
445
|
+
* @returns {Object} jQuery-like object for the element.
|
446
|
+
*/
|
386
447
|
function _enquery_clone() {
|
387
448
|
|
388
449
|
let clones =
|
@@ -7,10 +7,14 @@ is permitted, for more information consult the project license file.
|
|
7
7
|
|
8
8
|
|
9
9
|
|
10
|
+
/**
|
11
|
+
* Convert the provided seconds in a human friendly format.
|
12
|
+
*
|
13
|
+
* @returns {Object} jQuery-like object for the element.
|
14
|
+
*/
|
10
15
|
function duration(
|
11
16
|
seconds,
|
12
17
|
) {
|
13
|
-
// Convert the provided seconds in a human friendly format.
|
14
18
|
|
15
19
|
assert(!isnull(seconds));
|
16
20
|
|
@@ -128,10 +132,12 @@ function duration(
|
|
128
132
|
|
129
133
|
|
130
134
|
|
135
|
+
/**
|
136
|
+
* Determine the time in seconds occurring since instance.
|
137
|
+
*/
|
131
138
|
function _since(
|
132
139
|
value,
|
133
140
|
) {
|
134
|
-
// Determine the time in seconds occurring since instance.
|
135
141
|
|
136
142
|
assert(!isnull(value));
|
137
143
|
|