atomicshop 2.16.11__py3-none-any.whl → 2.16.13__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 atomicshop might be problematic. Click here for more details.
- atomicshop/__init__.py +1 -1
- atomicshop/basics/enums.py +2 -2
- atomicshop/basics/list_of_classes.py +29 -0
- atomicshop/file_io/docxs.py +4 -4
- atomicshop/filesystem.py +265 -198
- atomicshop/mitm/config_static.py +1 -1
- atomicshop/mitm/initialize_engines.py +6 -6
- atomicshop/mitm/{initialize_mitm_server.py → mitm_main.py} +4 -3
- atomicshop/mitm/recs_files.py +17 -16
- atomicshop/mitm/statistic_analyzer.py +2 -2
- atomicshop/wrappers/factw/install/pre_install_and_install_before_restart.py +1 -1
- atomicshop/wrappers/loggingw/reading.py +63 -100
- atomicshop/wrappers/socketw/socket_server_tester.py +5 -5
- {atomicshop-2.16.11.dist-info → atomicshop-2.16.13.dist-info}/METADATA +1 -1
- {atomicshop-2.16.11.dist-info → atomicshop-2.16.13.dist-info}/RECORD +18 -17
- {atomicshop-2.16.11.dist-info → atomicshop-2.16.13.dist-info}/LICENSE.txt +0 -0
- {atomicshop-2.16.11.dist-info → atomicshop-2.16.13.dist-info}/WHEEL +0 -0
- {atomicshop-2.16.11.dist-info → atomicshop-2.16.13.dist-info}/top_level.txt +0 -0
atomicshop/__init__.py
CHANGED
atomicshop/basics/enums.py
CHANGED
|
@@ -32,10 +32,10 @@ def __comparison_usage_example(
|
|
|
32
32
|
main folder.
|
|
33
33
|
|
|
34
34
|
Usage:
|
|
35
|
-
from atomicshop.filesystem import
|
|
35
|
+
from atomicshop.filesystem import get_paths_from_directory, ComparisonOperator
|
|
36
36
|
|
|
37
37
|
# Get full paths of all the 'engine_config.ini' files.
|
|
38
|
-
engine_config_path_list =
|
|
38
|
+
engine_config_path_list = get_paths_from_directory(
|
|
39
39
|
directory_fullpath=some_directory_path,
|
|
40
40
|
file_name_check_tuple=(config_file_name, ComparisonOperator.EQ))
|
|
41
41
|
"""
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from operator import attrgetter
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def sort_by_attributes(
|
|
5
|
+
list_instance: list,
|
|
6
|
+
attribute_list: list,
|
|
7
|
+
reverse: bool = False,
|
|
8
|
+
case_insensitive: bool = False
|
|
9
|
+
):
|
|
10
|
+
"""
|
|
11
|
+
Sort a list of objects by their attributes.
|
|
12
|
+
|
|
13
|
+
:param list_instance: list of objects.
|
|
14
|
+
:param attribute_list: list of attributes (strings). The sorting will be done by the attributes in the list.
|
|
15
|
+
In the appearing order in the list.
|
|
16
|
+
:param reverse: bool, sort in reverse order.
|
|
17
|
+
:param case_insensitive: bool, sorting will be case-insensitive.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
for attribute in attribute_list:
|
|
21
|
+
if case_insensitive:
|
|
22
|
+
list_instance = sorted(
|
|
23
|
+
list_instance, key=lambda obj: getattr(obj, attribute).lower(), reverse=reverse
|
|
24
|
+
)
|
|
25
|
+
else:
|
|
26
|
+
list_instance = sorted(
|
|
27
|
+
list_instance, key=attrgetter(attribute), reverse=reverse
|
|
28
|
+
)
|
|
29
|
+
return list_instance
|
atomicshop/file_io/docxs.py
CHANGED
|
@@ -74,20 +74,20 @@ def search_for_hyperlink_in_files(directory_path: str, hyperlink: str, relative_
|
|
|
74
74
|
raise NotADirectoryError(f"Directory doesn't exist: {directory_path}")
|
|
75
75
|
|
|
76
76
|
# Get all the docx files in the specified directory.
|
|
77
|
-
files = filesystem.
|
|
78
|
-
directory_path, file_name_check_pattern="*\.docx",
|
|
77
|
+
files = filesystem.get_paths_from_directory(
|
|
78
|
+
directory_path, get_file=True, file_name_check_pattern="*\.docx",
|
|
79
79
|
add_relative_directory=True, relative_file_name_as_directory=True)
|
|
80
80
|
|
|
81
81
|
found_in_files: list = list()
|
|
82
82
|
for file_path in files:
|
|
83
|
-
hyperlinks = get_hyperlinks(file_path
|
|
83
|
+
hyperlinks = get_hyperlinks(file_path.path)
|
|
84
84
|
if hyperlink in hyperlinks:
|
|
85
85
|
found_in_files.append(file_path)
|
|
86
86
|
|
|
87
87
|
if relative_paths:
|
|
88
88
|
result_list = list()
|
|
89
89
|
for found_file in found_in_files:
|
|
90
|
-
result_list.append(found_file
|
|
90
|
+
result_list.append(found_file.relative_dir)
|
|
91
91
|
else:
|
|
92
92
|
result_list = found_in_files
|
|
93
93
|
|