approval-utilities 14.0.0__py3-none-any.whl → 14.1.0__py3-none-any.whl
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.
Potentially problematic release.
This version of approval-utilities might be problematic. Click here for more details.
- approval_utilities/utils.py +18 -2
- {approval_utilities-14.0.0.dist-info → approval_utilities-14.1.0.dist-info}/METADATA +1 -1
- {approval_utilities-14.0.0.dist-info → approval_utilities-14.1.0.dist-info}/RECORD +6 -6
- {approval_utilities-14.0.0.dist-info → approval_utilities-14.1.0.dist-info}/WHEEL +1 -1
- {approval_utilities-14.0.0.dist-info → approval_utilities-14.1.0.dist-info}/LICENSE +0 -0
- {approval_utilities-14.0.0.dist-info → approval_utilities-14.1.0.dist-info}/top_level.txt +0 -0
approval_utilities/utils.py
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import inspect
|
|
2
2
|
import json
|
|
3
3
|
import os
|
|
4
|
+
|
|
4
5
|
from copy import deepcopy
|
|
5
6
|
|
|
7
|
+
from typing import Callable, Dict, TypeVar
|
|
8
|
+
|
|
6
9
|
|
|
7
10
|
def get_adjacent_file(name: str) -> str:
|
|
8
11
|
calling_file = inspect.stack(1)[1][1]
|
|
@@ -53,12 +56,17 @@ def is_windows_os() -> bool:
|
|
|
53
56
|
|
|
54
57
|
|
|
55
58
|
def create_empty_file(file_path: str) -> None:
|
|
56
|
-
|
|
59
|
+
try:
|
|
60
|
+
import empty_files.empty_files
|
|
57
61
|
|
|
58
|
-
|
|
62
|
+
empty_files.empty_files.create_empty_file(file_path)
|
|
63
|
+
except ImportError as e:
|
|
64
|
+
print("Error importing empty_files", e)
|
|
65
|
+
raise
|
|
59
66
|
|
|
60
67
|
|
|
61
68
|
def ensure_file_exists(approved_path: str) -> None:
|
|
69
|
+
print("approved_path check", approved_path)
|
|
62
70
|
if not os.path.isfile(approved_path):
|
|
63
71
|
create_empty_file(approved_path)
|
|
64
72
|
|
|
@@ -76,3 +84,11 @@ def print_grid(width, height, cell_print_func):
|
|
|
76
84
|
result += cell_print_func(x, y)
|
|
77
85
|
result += "\n"
|
|
78
86
|
return result
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
_V = TypeVar("_V")
|
|
90
|
+
_K = TypeVar("_K")
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def filter_values(filter: Callable[[_V], bool], a_dict: Dict[_K, _V]) -> Dict[_K, _V]:
|
|
94
|
+
return {k: v for k, v in a_dict.items() if filter(v)}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
approval_utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
approval_utilities/list_utils.py,sha256=7OT3YkysNmq3ZD7shzirQ8S9Yqf2rS7ckcMNKbC1Jf0,551
|
|
3
|
-
approval_utilities/utils.py,sha256=
|
|
3
|
+
approval_utilities/utils.py,sha256=PLtz9Lv8kHeiyI3urKo7FTiiynXq_TnAX18agWuT--I,2515
|
|
4
4
|
approval_utilities/approvaltests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
approval_utilities/approvaltests/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
approval_utilities/approvaltests/core/executable_command.py,sha256=LFLD36fAe1ek8YlKdZbj8j3dfJ8InFBnIGS8OzaDxDQ,428
|
|
@@ -27,8 +27,8 @@ approval_utilities/utilities/logger/simple_logger.py,sha256=-MQ1sii7u5VYFO_Zle51
|
|
|
27
27
|
approval_utilities/utilities/persistence/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
28
|
approval_utilities/utilities/persistence/loader.py,sha256=0kLYZRhJh_SX4j6Fxf_9jN64WcgcgMoFTKkUd10S9vM,218
|
|
29
29
|
approval_utilities/utilities/persistence/saver.py,sha256=_xZxyeNkzAweicun69mgBYSakyeObJxesy7aVAIdWl0,223
|
|
30
|
-
approval_utilities-14.
|
|
31
|
-
approval_utilities-14.
|
|
32
|
-
approval_utilities-14.
|
|
33
|
-
approval_utilities-14.
|
|
34
|
-
approval_utilities-14.
|
|
30
|
+
approval_utilities-14.1.0.dist-info/LICENSE,sha256=c7p036pSC0mkAbXSFFmoUjoUbzt1GKgz7qXvqFEwv2g,10273
|
|
31
|
+
approval_utilities-14.1.0.dist-info/METADATA,sha256=kydD39WMyRBbUqOvd_Fbxidel3WIEQmXarYaGg_mlus,1005
|
|
32
|
+
approval_utilities-14.1.0.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
|
33
|
+
approval_utilities-14.1.0.dist-info/top_level.txt,sha256=9uDtIZHmdLyDNIBh-jNfEM1dA6lBDmo5ftR376zOiv4,19
|
|
34
|
+
approval_utilities-14.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|