atomicshop 3.1.0__py3-none-any.whl → 3.1.1__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 CHANGED
@@ -1,4 +1,4 @@
1
1
  """Atomic Basic functions and classes to make developer life easier"""
2
2
 
3
3
  __author__ = "Den Kras"
4
- __version__ = '3.1.0'
4
+ __version__ = '3.1.1'
@@ -181,7 +181,7 @@ def thread_worker_main(
181
181
  network_logger.info("Thread Finished. Will continue listening on the Main thread")
182
182
 
183
183
  def create_requester_request(client_message: ClientMessage) -> list[bytes]:
184
- requests: list = [requester.create_response(client_message)]
184
+ requests: list = [requester.create_request(client_message)]
185
185
 
186
186
  # Output first 100 characters of all the requests in the list.
187
187
  for request_raw_bytes_single in requests:
@@ -76,7 +76,7 @@ class RecorderParent:
76
76
  self.recorder_worker_thread = threading.Thread(
77
77
  target=save_message_worker,
78
78
  args=(self.record_file_path, self.message_queue, self.logger),
79
- name=f"Thread-{self.class_client_message.thread_id}_Recorder",
79
+ name=f"Thread-{self.class_client_message.thread_id}-Recorder",
80
80
  daemon=True
81
81
  )
82
82
  self.recorder_worker_thread.start()
@@ -80,7 +80,7 @@ class CreateModuleTemplate:
80
80
 
81
81
  config_lines_list.append('[engine]')
82
82
  config_lines_list.append(f'domains = [{", ".join(domains_with_quotes)}]')
83
- config_lines_list.append('localhost = 0\n')
83
+ config_lines_list.append('localhost = 1\n')
84
84
  # config_lines_list.append(f'\n')
85
85
  config_lines_list.append('[mtls]')
86
86
  config_lines_list.append('# "subdomain.domain.com" = "file_name_in_current_dir.pem"\n')
@@ -89,7 +89,10 @@ def import_engines_configs() -> int:
89
89
  # Initialize engine.
90
90
  current_module: initialize_engines.ModuleCategory = initialize_engines.ModuleCategory(config_static.MainConfig.SCRIPT_DIRECTORY)
91
91
  current_module.fill_engine_fields_from_config(engine_config_path.path)
92
- current_module.initialize_engine()
92
+ result_code, error = current_module.initialize_engine()
93
+ if result_code != 0:
94
+ print_api(f"Error initializing engine from directory: {Path(engine_config_path.path).parent}\n{error}", color='red')
95
+ return result_code
93
96
 
94
97
  # Extending the full engine domain list with this list.
95
98
  domains_engine_list_full.extend(current_module.domain_list)
@@ -99,7 +102,10 @@ def import_engines_configs() -> int:
99
102
  # ==== Initialize Reference Module =============================================================================
100
103
  reference_module: initialize_engines.ModuleCategory = initialize_engines.ModuleCategory(config_static.MainConfig.SCRIPT_DIRECTORY)
101
104
  reference_module.fill_engine_fields_from_general_reference(config_static.MainConfig.ENGINES_DIRECTORY_PATH)
102
- reference_module.initialize_engine(reference_general=True)
105
+ result_code, error = reference_module.initialize_engine(reference_general=True)
106
+ if result_code != 0:
107
+ print_api(f"Error initializing reference engine from file: {config_static.MainConfig.ENGINES_DIRECTORY_PATH}\n{error}", color='red')
108
+ return result_code
103
109
 
104
110
  # Assigning all the engines domains to all time domains, that will be responsible for adding new domains.
105
111
  config_static.Certificates.domains_all_times = list(domains_engine_list_full)
@@ -3,8 +3,8 @@ from pathlib import Path
3
3
 
4
4
  from ..file_io import tomls
5
5
  from ..basics.classes import import_first_class_name_from_file_path
6
- from .engines.__reference_general import parser___reference_general, responder___reference_general, \
7
- recorder___reference_general
6
+ from .engines.__reference_general import parser___reference_general, requester___reference_general, \
7
+ responder___reference_general, recorder___reference_general
8
8
 
9
9
 
10
10
  class ModuleCategory:
@@ -18,10 +18,12 @@ class ModuleCategory:
18
18
  self.mtls: dict = dict()
19
19
 
20
20
  self.parser_file_path: str = str()
21
+ self.requester_file_path: str = str()
21
22
  self.responder_file_path: str = str()
22
23
  self.recorder_file_path: str = str()
23
24
 
24
25
  self.parser_class_object: str = str()
26
+ self.requester_class_object: str = str()
25
27
  self.responder_class_object: str = str()
26
28
  self.recorder_class_object: str = str()
27
29
 
@@ -31,6 +33,7 @@ class ModuleCategory:
31
33
  reference_folder_path: str = engines_fullpath + os.sep + self.engine_name
32
34
  # Full path to file.
33
35
  self.parser_file_path = reference_folder_path + os.sep + "parser___reference_general.py"
36
+ self.requester_file_path = reference_folder_path + os.sep + "requester___reference_general.py"
34
37
  self.responder_file_path = reference_folder_path + os.sep + "responder___reference_general.py"
35
38
  self.recorder_file_path = reference_folder_path + os.sep + "recorder___reference_general.py"
36
39
 
@@ -62,6 +65,7 @@ class ModuleCategory:
62
65
 
63
66
  # Full path to file
64
67
  self.parser_file_path = f"{engine_directory_path}{os.sep}parser{file_name_suffix}.py"
68
+ self.requester_file_path = f"{engine_directory_path}{os.sep}requester{file_name_suffix}.py"
65
69
  self.responder_file_path = f"{engine_directory_path}{os.sep}responder{file_name_suffix}.py"
66
70
  self.recorder_file_path = f"{engine_directory_path}{os.sep}recorder{file_name_suffix}.py"
67
71
 
@@ -74,18 +78,26 @@ class ModuleCategory:
74
78
  for subdomain, file_name in self.mtls.items():
75
79
  self.mtls[subdomain] = f'{engine_directory_path}{os.sep}{file_name}'
76
80
 
77
- def initialize_engine(self, reference_general: bool = False):
78
- if not reference_general:
79
- self.parser_class_object = import_first_class_name_from_file_path(
80
- self.script_directory, self.parser_file_path)
81
- self.responder_class_object = import_first_class_name_from_file_path(
82
- self.script_directory, self.responder_file_path)
83
- self.recorder_class_object = import_first_class_name_from_file_path(
84
- self.script_directory, self.recorder_file_path)
85
- else:
86
- self.parser_class_object = parser___reference_general.ParserGeneral
87
- self.responder_class_object = responder___reference_general.ResponderGeneral
88
- self.recorder_class_object = recorder___reference_general.RecorderGeneral
81
+ def initialize_engine(self, reference_general: bool = False) -> tuple[int, str]:
82
+ try:
83
+ if not reference_general:
84
+ self.parser_class_object = import_first_class_name_from_file_path(
85
+ self.script_directory, self.parser_file_path)
86
+ self.requester_class_object = import_first_class_name_from_file_path(
87
+ self.script_directory, self.requester_file_path)
88
+ self.responder_class_object = import_first_class_name_from_file_path(
89
+ self.script_directory, self.responder_file_path)
90
+ self.recorder_class_object = import_first_class_name_from_file_path(
91
+ self.script_directory, self.recorder_file_path)
92
+ else:
93
+ self.parser_class_object = parser___reference_general.ParserGeneral
94
+ self.requester_class_object = requester___reference_general.RequesterGeneral
95
+ self.responder_class_object = responder___reference_general.ResponderGeneral
96
+ self.recorder_class_object = recorder___reference_general.RecorderGeneral
97
+ except ModuleNotFoundError as e:
98
+ return 1, str(e)
99
+
100
+ return 0, ''
89
101
 
90
102
 
91
103
  def assign_class_by_domain(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: atomicshop
3
- Version: 3.1.0
3
+ Version: 3.1.1
4
4
  Summary: Atomic functions and classes to make developer life easier
5
5
  Author: Denis Kras
6
6
  License: MIT License
@@ -1,4 +1,4 @@
1
- atomicshop/__init__.py,sha256=91TkRXyPpHainjVtqMX8IhnOPsq4mLI4-W-pBKoiPbk,122
1
+ atomicshop/__init__.py,sha256=xTnJCkq3gj1NeN0vpvfRoCBltskMb4tZN_7g3G8Sg28,122
2
2
  atomicshop/_basics_temp.py,sha256=6cu2dd6r2dLrd1BRNcVDKTHlsHs_26Gpw8QS6v32lQ0,3699
3
3
  atomicshop/_create_pdf_demo.py,sha256=Yi-PGZuMg0RKvQmLqVeLIZYadqEZwUm-4A9JxBl_vYA,3713
4
4
  atomicshop/_patch_import.py,sha256=ENp55sKVJ0e6-4lBvZnpz9PQCt3Otbur7F6aXDlyje4,6334
@@ -136,20 +136,20 @@ atomicshop/file_io/xmls.py,sha256=zh3SuK-dNaFq2NDNhx6ivcf4GYCfGM8M10PcEwDSpxk,21
136
136
  atomicshop/mitm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
137
137
  atomicshop/mitm/config_static.py,sha256=N3D06C_wUytwm80PQCL90ZGHLMHeQlCcI2XQQU2FZ1I,8145
138
138
  atomicshop/mitm/config_toml_editor.py,sha256=2p1CMcktWRR_NW-SmyDwylu63ad5e0-w1QPMa8ZLDBw,1635
139
- atomicshop/mitm/connection_thread_worker.py,sha256=H3Ogwo9iMG4WgKZabJGl69_haIkEsMR4p6l4CGbwBYU,28500
140
- atomicshop/mitm/import_config.py,sha256=MbMgX5IpqC6fUZUTHLOtHyHbzab2tG4RgD2O18csKcI,16506
141
- atomicshop/mitm/initialize_engines.py,sha256=lucq9LwkWTnrYKsnt8bgs8t9R_y3gOPmzLyEmRuXD8s,6628
139
+ atomicshop/mitm/connection_thread_worker.py,sha256=ulE5x3hxWyd6gSyahSE-wpnF6VYl_wsJNBbNC0DzKU4,28499
140
+ atomicshop/mitm/import_config.py,sha256=gCH1hV-CxBAdwjeFJu1I5ntbm5hqzcB0y0vzRPkzra0,16936
141
+ atomicshop/mitm/initialize_engines.py,sha256=Pj9k3iLdoE0KAl3QWG1Z10LHUHY8WQivSPFnQLhCWrc,7385
142
142
  atomicshop/mitm/message.py,sha256=CDhhm4BTuZE7oNZCjvIZ4BuPOW4MuIzQLOg91hJaxDI,3065
143
143
  atomicshop/mitm/mitm_main.py,sha256=cfQLaPaUZgluatlZDRiToi14ekZbPT2KM4-AiivTs3w,30055
144
144
  atomicshop/mitm/recs_files.py,sha256=ZAAD0twun-FtmbSniXe3XQhIlawvANNB_HxwbHj7kwI,3151
145
145
  atomicshop/mitm/shared_functions.py,sha256=0lzeyINd44sVEfFbahJxQmz6KAMWbYrW5ou3UYfItvw,1777
146
146
  atomicshop/mitm/statistic_analyzer.py,sha256=5_sAYGX2Xunzo_pS2W5WijNCwr_BlGJbbOO462y_wN4,27533
147
147
  atomicshop/mitm/engines/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
148
- atomicshop/mitm/engines/create_module_template.py,sha256=nZE99lwHc_Wm4zmEt7P3cEw3E32Ms65dVbhqZbqOV6U,5577
148
+ atomicshop/mitm/engines/create_module_template.py,sha256=Qu7ca72BsbcPrtonJM1ok7pGlwu0u6gEDap1ht6vMw0,5577
149
149
  atomicshop/mitm/engines/create_module_template_main_example.py,sha256=LeQ44Rp2Gi_KbIDY_4OMS0odkSK3zFZWra_oAka5eJY,243
150
150
  atomicshop/mitm/engines/__parent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
151
151
  atomicshop/mitm/engines/__parent/parser___parent.py,sha256=HHaCXhScl3OlPjz6eUxsDpJaZyk6BNuDMc9xCkeo2Ws,661
152
- atomicshop/mitm/engines/__parent/recorder___parent.py,sha256=JbbcpV6j4odvREmvcXQlzKr5_hwLiEHhF0O414PlTes,6010
152
+ atomicshop/mitm/engines/__parent/recorder___parent.py,sha256=I5RNNtqc2DRIm1E9grOkTvk9F79mfJvTl9vfVEUgcLE,6010
153
153
  atomicshop/mitm/engines/__parent/requester___parent.py,sha256=mKHR1xrfx0CCO74vv164Fr_dVDhptqvYsE3ORoM4_7k,5107
154
154
  atomicshop/mitm/engines/__parent/responder___parent.py,sha256=mtiS_6ej9nxT9UhAQR4ftMqnqL-j_kO3u8KEaoEaI9k,9495
155
155
  atomicshop/mitm/engines/__reference_general/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -336,8 +336,8 @@ atomicshop/wrappers/socketw/statistics_csv.py,sha256=WcNyaqEZ82S5-f3kzqi1nllNT2N
336
336
  atomicshop/wrappers/winregw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
337
337
  atomicshop/wrappers/winregw/winreg_installed_software.py,sha256=Qzmyktvob1qp6Tjk2DjLfAqr_yXV0sgWzdMW_9kwNjY,2345
338
338
  atomicshop/wrappers/winregw/winreg_network.py,sha256=3Ts1sVqSUiCDsHRHwJCbiZ9EYvv2ELGxF0Y_pibGU4k,9596
339
- atomicshop-3.1.0.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
340
- atomicshop-3.1.0.dist-info/METADATA,sha256=CvGoKMdS-InZlR0Mk23zWG7_g9YqXprrxx05qwPwHiY,10653
341
- atomicshop-3.1.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
342
- atomicshop-3.1.0.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
343
- atomicshop-3.1.0.dist-info/RECORD,,
339
+ atomicshop-3.1.1.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
340
+ atomicshop-3.1.1.dist-info/METADATA,sha256=NGjnb2e0ON4vpeuBk4ELqQCNXm9SwV1o9L1js94ufRY,10653
341
+ atomicshop-3.1.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
342
+ atomicshop-3.1.1.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
343
+ atomicshop-3.1.1.dist-info/RECORD,,