atomicshop 2.16.8__py3-none-any.whl → 2.16.10__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/file_io/file_io.py +5 -1
- atomicshop/mitm/recs_files.py +38 -25
- {atomicshop-2.16.8.dist-info → atomicshop-2.16.10.dist-info}/METADATA +1 -1
- {atomicshop-2.16.8.dist-info → atomicshop-2.16.10.dist-info}/RECORD +8 -8
- {atomicshop-2.16.8.dist-info → atomicshop-2.16.10.dist-info}/LICENSE.txt +0 -0
- {atomicshop-2.16.8.dist-info → atomicshop-2.16.10.dist-info}/WHEEL +0 -0
- {atomicshop-2.16.8.dist-info → atomicshop-2.16.10.dist-info}/top_level.txt +0 -0
atomicshop/__init__.py
CHANGED
atomicshop/file_io/file_io.py
CHANGED
|
@@ -95,7 +95,11 @@ def write_file(
|
|
|
95
95
|
"""
|
|
96
96
|
|
|
97
97
|
if isinstance(content, list):
|
|
98
|
-
|
|
98
|
+
for line in content:
|
|
99
|
+
if not line.endswith("\n"):
|
|
100
|
+
file_object.write(line + "\n")
|
|
101
|
+
else:
|
|
102
|
+
file_object.write(line)
|
|
99
103
|
elif isinstance(content, str):
|
|
100
104
|
file_object.write(content)
|
|
101
105
|
# THis will happen if the content is bytes and the file mode is 'wb'.
|
atomicshop/mitm/recs_files.py
CHANGED
|
@@ -21,32 +21,45 @@ def recs_archiver(recs_directory: str) -> list:
|
|
|
21
21
|
|
|
22
22
|
today_date_string = datetime.datetime.now().strftime(REC_FILE_DATE_FORMAT)
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
recs_file_dict['file_path'], f'{target_directory_path}{os.sep}{recs_file_dict["file_name"]}')
|
|
43
|
-
|
|
44
|
-
# Archive directories.
|
|
24
|
+
# There should not be recording json files in recs root.
|
|
25
|
+
files_in_recs_root: list = filesystem.get_file_paths_from_directory(
|
|
26
|
+
recs_directory, file_name_check_pattern='*.json', recursive=False)
|
|
27
|
+
if files_in_recs_root:
|
|
28
|
+
raise NotImplementedError("The files in recs root directory are not implemented yet.")
|
|
29
|
+
|
|
30
|
+
# Each engine should have its own directory inside recordings. We will find all the directories inside recs folder.
|
|
31
|
+
directory_paths_in_recs: list = filesystem.get_directory_paths_from_directory(recs_directory, recursive=False)
|
|
32
|
+
|
|
33
|
+
file_list_per_directory: list = list()
|
|
34
|
+
for directory_path in directory_paths_in_recs:
|
|
35
|
+
all_recs_files = reading.get_logs_paths(
|
|
36
|
+
log_files_directory_path=directory_path,
|
|
37
|
+
file_name_pattern='*.json',
|
|
38
|
+
date_format=REC_FILE_DATE_FORMAT
|
|
39
|
+
)
|
|
40
|
+
file_list_per_directory.append((directory_path, all_recs_files))
|
|
41
|
+
|
|
45
42
|
archived_files: list = list()
|
|
46
|
-
for
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
for directory_path, all_recs_files in file_list_per_directory:
|
|
44
|
+
archive_directories: list = list()
|
|
45
|
+
for recs_file_dict in all_recs_files:
|
|
46
|
+
# We don't need to archive today's files.
|
|
47
|
+
if today_date_string == recs_file_dict['date_string']:
|
|
48
|
+
continue
|
|
49
|
+
|
|
50
|
+
target_directory_path: str = f"{directory_path}{os.sep}{recs_file_dict['date_string']}"
|
|
51
|
+
if target_directory_path not in archive_directories:
|
|
52
|
+
archive_directories.append(target_directory_path)
|
|
53
|
+
|
|
54
|
+
filesystem.create_directory(target_directory_path)
|
|
55
|
+
filesystem.move_file(
|
|
56
|
+
recs_file_dict['file_path'], f'{target_directory_path}{os.sep}{recs_file_dict["file_name"]}')
|
|
57
|
+
|
|
58
|
+
# Archive directories.
|
|
59
|
+
for archive_directory in archive_directories:
|
|
60
|
+
archived_file: str = zips.archive_directory(
|
|
61
|
+
archive_directory, remove_original=True, include_root_directory=True)
|
|
62
|
+
archived_files.append(archived_file)
|
|
50
63
|
|
|
51
64
|
return archived_files
|
|
52
65
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
atomicshop/__init__.py,sha256=
|
|
1
|
+
atomicshop/__init__.py,sha256=UgRp7GQHNpZPeGG_7JeMEqk614zuaQR7CEQKP3aHIpM,124
|
|
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
|
|
@@ -115,7 +115,7 @@ atomicshop/etws/traces/trace_sysmon_process_creation.py,sha256=OM-bkK38uYMwWLZKN
|
|
|
115
115
|
atomicshop/file_io/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
116
116
|
atomicshop/file_io/csvs.py,sha256=oZiaIEd1q50ypNdd9mlHWb-f7HAdGa_D6jLd3T_4sWU,8777
|
|
117
117
|
atomicshop/file_io/docxs.py,sha256=rZnv2VMOvct6KBSQn-bHhwbKOi8886jB5u387flq-0E,5755
|
|
118
|
-
atomicshop/file_io/file_io.py,sha256=
|
|
118
|
+
atomicshop/file_io/file_io.py,sha256=A4_0xwruhQ8jSPpCCTlIBmuLLVB0GHQgiSVznVi4cV0,6395
|
|
119
119
|
atomicshop/file_io/jsons.py,sha256=q9ZU8slBKnHLrtn3TnbK1qxrRpj5ZvCm6AlsFzoANjo,5303
|
|
120
120
|
atomicshop/file_io/tomls.py,sha256=ol8EvQPf9sryTmZUf1v55BYSUQ6ml7HVVBHpNKbsIlA,9768
|
|
121
121
|
atomicshop/file_io/xlsxs.py,sha256=v_dyg9GD4LqgWi6wA1QuWRZ8zG4ZwB6Dz52ytdcmmmI,2184
|
|
@@ -128,7 +128,7 @@ atomicshop/mitm/import_config.py,sha256=fvUESPMkpRvkL7HtMaUqQRPwPF0eHV5V6pwueg4D
|
|
|
128
128
|
atomicshop/mitm/initialize_engines.py,sha256=YoSNksMdu4vHjr5xy77t9t5W74zyDZIdjIXrzd3eRXc,8204
|
|
129
129
|
atomicshop/mitm/initialize_mitm_server.py,sha256=hwqVk6PMc2iDpl0bLwbUlPrxEmu7Ql75-WWCJxiKh1g,19320
|
|
130
130
|
atomicshop/mitm/message.py,sha256=fHvYEyEx-FAXbIMrKMJ_ybBinezF6IFbPlwCqpRrF44,1768
|
|
131
|
-
atomicshop/mitm/recs_files.py,sha256=
|
|
131
|
+
atomicshop/mitm/recs_files.py,sha256=Vu5Pve5-b4sONPTOtes-DkU-JeHG5Lxs2JdVZW-FYVM,2929
|
|
132
132
|
atomicshop/mitm/shared_functions.py,sha256=hplm98tz8pgJ4WHUVI9sf_oVqUM2KJ1Y2pD6EFSb8P0,1879
|
|
133
133
|
atomicshop/mitm/statistic_analyzer.py,sha256=E0ba1PjsUEcmQUPPw2YH911lyWkbQb9OSAdgB3pihsY,24658
|
|
134
134
|
atomicshop/mitm/engines/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -305,8 +305,8 @@ atomicshop/wrappers/socketw/socket_server_tester.py,sha256=SdchUf9qrPk1Rrat0RzvM
|
|
|
305
305
|
atomicshop/wrappers/socketw/socket_wrapper.py,sha256=g7f_8RkW80EZeQWNTqGYnfrQkgAI56T3SwWybq7ZsXg,28521
|
|
306
306
|
atomicshop/wrappers/socketw/ssl_base.py,sha256=k4V3gwkbq10MvOH4btU4onLX2GNOsSfUAdcHmL1rpVE,2274
|
|
307
307
|
atomicshop/wrappers/socketw/statistics_csv.py,sha256=Jc0D12crkKRaqoCRQ-2Mz1zm6n4UUx9dXakf-N2TYWA,3065
|
|
308
|
-
atomicshop-2.16.
|
|
309
|
-
atomicshop-2.16.
|
|
310
|
-
atomicshop-2.16.
|
|
311
|
-
atomicshop-2.16.
|
|
312
|
-
atomicshop-2.16.
|
|
308
|
+
atomicshop-2.16.10.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
|
|
309
|
+
atomicshop-2.16.10.dist-info/METADATA,sha256=9CV_gguQyOeLDaXaDj8mdHaQRQytxupfMD07fdyYi1o,10503
|
|
310
|
+
atomicshop-2.16.10.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
311
|
+
atomicshop-2.16.10.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
|
|
312
|
+
atomicshop-2.16.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|