atomicshop 2.14.12__py3-none-any.whl → 2.14.14__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/config_init.py +1 -1
- atomicshop/filesystem.py +14 -3
- atomicshop/mitm/import_config.py +3 -3
- atomicshop/mitm/statistic_analyzer.py +79 -478
- atomicshop/mitm/statistic_analyzer_helper/__init__.py +0 -0
- atomicshop/mitm/statistic_analyzer_helper/analyzer_helper.py +136 -0
- atomicshop/mitm/statistic_analyzer_helper/moving_average_helper.py +330 -0
- atomicshop/question_answer_engine.py +2 -2
- atomicshop/wrappers/elasticsearchw/infrastructure.py +1 -1
- atomicshop/wrappers/loggingw/reading.py +2 -3
- atomicshop/wrappers/socketw/socket_client.py +1 -1
- {atomicshop-2.14.12.dist-info → atomicshop-2.14.14.dist-info}/METADATA +1 -1
- {atomicshop-2.14.12.dist-info → atomicshop-2.14.14.dist-info}/RECORD +17 -14
- {atomicshop-2.14.12.dist-info → atomicshop-2.14.14.dist-info}/LICENSE.txt +0 -0
- {atomicshop-2.14.12.dist-info → atomicshop-2.14.14.dist-info}/WHEEL +0 -0
- {atomicshop-2.14.12.dist-info → atomicshop-2.14.14.dist-info}/top_level.txt +0 -0
atomicshop/__init__.py
CHANGED
atomicshop/config_init.py
CHANGED
|
@@ -58,7 +58,7 @@ def write_config(
|
|
|
58
58
|
|
|
59
59
|
config_file_path = f'{script_directory}{os.sep}{config_file_name}'
|
|
60
60
|
|
|
61
|
-
if not filesystem.
|
|
61
|
+
if not filesystem.is_file_exists(config_file_path):
|
|
62
62
|
tomls.write_toml_file(config, f'{script_directory}{os.sep}{config_file_name}')
|
|
63
63
|
|
|
64
64
|
if print_message:
|
atomicshop/filesystem.py
CHANGED
|
@@ -449,7 +449,7 @@ def move_file(source_file_path: str, target_file_path: str, overwrite: bool = Tr
|
|
|
449
449
|
|
|
450
450
|
# Check if 'no_overwrite' is set to 'True' and if the file exists.
|
|
451
451
|
if not overwrite:
|
|
452
|
-
if
|
|
452
|
+
if is_file_exists(target_file_path):
|
|
453
453
|
raise FileExistsError(f'File already exists: {target_file_path}')
|
|
454
454
|
|
|
455
455
|
# Move file.
|
|
@@ -465,6 +465,17 @@ def move_folder(source_directory: str, target_directory: str, overwrite: bool =
|
|
|
465
465
|
:param overwrite: boolean, if 'False', then the function will not overwrite the directory if it exists.
|
|
466
466
|
|
|
467
467
|
:return: None
|
|
468
|
+
|
|
469
|
+
------------------------------
|
|
470
|
+
|
|
471
|
+
Example:
|
|
472
|
+
source_directory = 'C:/Users/user1/Downloads/folder-to-move'
|
|
473
|
+
target_directory = 'C:/Users/user1/Documents'
|
|
474
|
+
move_folder(source_directory, target_directory)
|
|
475
|
+
|
|
476
|
+
Result path of the 'folder-to-move' will be:
|
|
477
|
+
'C:/Users/user1/Documents/folder-to-move'
|
|
478
|
+
|
|
468
479
|
"""
|
|
469
480
|
|
|
470
481
|
# Check if 'overwrite' is set to 'True' and if the directory exists.
|
|
@@ -532,7 +543,7 @@ def copy_file(
|
|
|
532
543
|
|
|
533
544
|
# Check if 'no_overwrite' is set to 'True' and if the file exists.
|
|
534
545
|
if no_overwrite:
|
|
535
|
-
if
|
|
546
|
+
if is_file_exists(target_file_path):
|
|
536
547
|
raise FileExistsError(f'File already exists: {target_file_path}')
|
|
537
548
|
|
|
538
549
|
# Copy file.
|
|
@@ -1432,7 +1443,7 @@ def backup_file(file_path: str, backup_directory: str, timestamp_as_prefix: bool
|
|
|
1432
1443
|
Final path will look like: 'C:\\Users\\user1\\Downloads\\backup\\file_20231003-120000-000000.txt'
|
|
1433
1444
|
"""
|
|
1434
1445
|
|
|
1435
|
-
if
|
|
1446
|
+
if is_file_exists(file_path):
|
|
1436
1447
|
timestamp: str = datetimes.TimeFormats().get_current_formatted_time_filename_stamp(True)
|
|
1437
1448
|
file_name_no_extension = Path(file_path).stem
|
|
1438
1449
|
file_extension = Path(file_path).suffix
|
atomicshop/mitm/import_config.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import sys
|
|
2
2
|
|
|
3
3
|
from ..wrappers.configparserw import ConfigParserWrapper
|
|
4
|
-
from ..
|
|
4
|
+
from .. import filesystem
|
|
5
5
|
from ..permissions import is_admin
|
|
6
6
|
from ..basics.booleans import check_3_booleans_when_only_1_can_be_true
|
|
7
7
|
|
|
@@ -125,13 +125,13 @@ class ImportConfig:
|
|
|
125
125
|
# If 'custom_certificate_usage' was set to 'True'.
|
|
126
126
|
if self.config['certificates']['custom_server_certificate_usage']:
|
|
127
127
|
# Check file existence.
|
|
128
|
-
if not
|
|
128
|
+
if not filesystem.is_file_exists(file_path=self.config['certificates']['custom_server_certificate_path']):
|
|
129
129
|
raise FileNotFoundError
|
|
130
130
|
|
|
131
131
|
# And if 'custom_private_key_path' field was populated in [advanced] section, we'll check its existence.
|
|
132
132
|
if self.config['certificates']['custom_private_key_path']:
|
|
133
133
|
# Check private key file existence.
|
|
134
|
-
if not
|
|
134
|
+
if not filesystem.is_file_exists(file_path=self.config['certificates']['custom_private_key_path']):
|
|
135
135
|
raise FileNotFoundError
|
|
136
136
|
|
|
137
137
|
skip_extensions: list = list()
|