atomicshop 2.10.5__py3-none-any.whl → 2.10.7__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/docxs.py +18 -6
- atomicshop/filesystem.py +3 -0
- atomicshop/system_resources.py +9 -3
- {atomicshop-2.10.5.dist-info → atomicshop-2.10.7.dist-info}/METADATA +1 -1
- {atomicshop-2.10.5.dist-info → atomicshop-2.10.7.dist-info}/RECORD +9 -9
- {atomicshop-2.10.5.dist-info → atomicshop-2.10.7.dist-info}/LICENSE.txt +0 -0
- {atomicshop-2.10.5.dist-info → atomicshop-2.10.7.dist-info}/WHEEL +0 -0
- {atomicshop-2.10.5.dist-info → atomicshop-2.10.7.dist-info}/top_level.txt +0 -0
atomicshop/__init__.py
CHANGED
atomicshop/file_io/docxs.py
CHANGED
|
@@ -19,7 +19,7 @@ def get_hyperlinks(docx_path):
|
|
|
19
19
|
# If the file is empty, it will raise an exception.
|
|
20
20
|
# The same exception will rise if the file is opened in Word.
|
|
21
21
|
except PackageNotFoundError:
|
|
22
|
-
print_api(f"File is
|
|
22
|
+
print_api(f"File is not DOCX format or opened in Word: {docx_path}", color="red", error_type=True)
|
|
23
23
|
return hyperlinks
|
|
24
24
|
|
|
25
25
|
for paragraph in doc.paragraphs:
|
|
@@ -67,7 +67,7 @@ def search_for_hyperlink_in_files(directory_path: str, hyperlink: str, relative_
|
|
|
67
67
|
|
|
68
68
|
# Get all the docx files in the specified directory.
|
|
69
69
|
files = filesystem.get_file_paths_from_directory(
|
|
70
|
-
directory_path, file_name_check_pattern="
|
|
70
|
+
directory_path, file_name_check_pattern="*\.docx",
|
|
71
71
|
add_relative_directory=True, relative_file_name_as_directory=True)
|
|
72
72
|
|
|
73
73
|
found_in_files: list = list()
|
|
@@ -98,14 +98,23 @@ def search_for_hyperlink_in_files_interface_main(script_directory: str = None):
|
|
|
98
98
|
def main():
|
|
99
99
|
docxs.search_for_hyperlink_in_files_interface_main()
|
|
100
100
|
|
|
101
|
+
# Create the 'config.toml' file if it doesn't exist.
|
|
102
|
+
# Run the script the first time in order to create empty TOML.
|
|
103
|
+
# Note: relative_paths: boolean, if True, the function will return relative paths to the files and not the full
|
|
104
|
+
# file paths. Example: 'content\file.docx' instead of 'D:/content/file.docx' if you specified 'D:/' as
|
|
105
|
+
# 'directory_path'.
|
|
106
|
+
# hyperlink = 'https://www.example.com'
|
|
107
|
+
# directory_path = 'C:/where/to/look/for/docxs'
|
|
108
|
+
# relative_paths = True
|
|
109
|
+
|
|
101
110
|
if __name__ == '__main__':
|
|
102
111
|
main()
|
|
103
112
|
"""
|
|
104
113
|
|
|
105
114
|
# Create the 'config.toml' file if it doesn't exist. Manually constructing the TOML content.
|
|
106
115
|
toml_dict = {
|
|
107
|
-
'directory_path': '',
|
|
108
116
|
'hyperlink': '',
|
|
117
|
+
'directory_path': '',
|
|
109
118
|
'relative_paths': True
|
|
110
119
|
}
|
|
111
120
|
|
|
@@ -117,7 +126,10 @@ def search_for_hyperlink_in_files_interface_main(script_directory: str = None):
|
|
|
117
126
|
found_in_files = search_for_hyperlink_in_files(
|
|
118
127
|
config['directory_path'], config['hyperlink'], relative_paths=config['relative_paths'])
|
|
119
128
|
|
|
120
|
-
|
|
121
|
-
|
|
129
|
+
print_api(f"Found in [{len(found_in_files)}] files:", color="blue")
|
|
130
|
+
|
|
131
|
+
for index, found_file in enumerate(found_in_files):
|
|
132
|
+
print_api(f"[{index+1}]", print_end="", color="green")
|
|
133
|
+
print_api(f" {found_file}")
|
|
122
134
|
|
|
123
|
-
input('
|
|
135
|
+
input('[*] Press [Enter] to exit...')
|
atomicshop/filesystem.py
CHANGED
|
@@ -569,6 +569,9 @@ def get_file_paths_from_directory(
|
|
|
569
569
|
:param file_name_check_pattern: string, if specified, the function will return only files that match the pattern.
|
|
570
570
|
The string can contain part of file name to check or full file name with extension.
|
|
571
571
|
Can contain wildcards.
|
|
572
|
+
If you need to specify a "." in the pattern, you need to escape it with a backslash:
|
|
573
|
+
Example: "*\.txt" will return all files with the extension ".txt".
|
|
574
|
+
While "*.txt" will return all files that contain "txt" in the name.
|
|
572
575
|
:param add_relative_directory: boolean, if
|
|
573
576
|
'True', then the function will add relative directory to the output list.
|
|
574
577
|
In this case the output list will contain dictionaries with keys 'path' and 'relative_dir'.
|
atomicshop/system_resources.py
CHANGED
|
@@ -114,12 +114,18 @@ def wait_for_resource_availability(
|
|
|
114
114
|
:return: None
|
|
115
115
|
"""
|
|
116
116
|
while True:
|
|
117
|
+
# Check system resources. If system_monitor_manager_dict is provided, use it.
|
|
117
118
|
if system_monitor_manager_dict:
|
|
118
|
-
result = system_monitor_manager_dict
|
|
119
|
+
result = dict(system_monitor_manager_dict)
|
|
119
120
|
else:
|
|
120
121
|
result = check_system_resources(
|
|
121
|
-
get_cpu=True,
|
|
122
|
-
|
|
122
|
+
get_cpu=True,
|
|
123
|
+
get_memory=True,
|
|
124
|
+
get_disk_io_bytes=False,
|
|
125
|
+
get_disk_files_count=False,
|
|
126
|
+
get_disk_busy_time=False,
|
|
127
|
+
get_disk_used_percent=False
|
|
128
|
+
)
|
|
123
129
|
|
|
124
130
|
if result['cpu_usage'] < cpu_percent_max and result['memory_usage'] < memory_percent_max:
|
|
125
131
|
break
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
atomicshop/__init__.py,sha256=
|
|
1
|
+
atomicshop/__init__.py,sha256=vu5q8ySTkwFbvPKFp-n_QzYPdTkOqmsJBYzW3_tVoRQ,123
|
|
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
|
|
@@ -14,7 +14,7 @@ atomicshop/dns.py,sha256=bNZOo5jVPzq7OT2qCPukXoK3zb1oOsyaelUwQEyK1SA,2500
|
|
|
14
14
|
atomicshop/domains.py,sha256=Rxu6JhhMqFZRcoFs69IoEd1PtYca0lMCG6F1AomP7z4,3197
|
|
15
15
|
atomicshop/emails.py,sha256=I0KyODQpIMEsNRi9YWSOL8EUPBiWyon3HRdIuSj3AEU,1410
|
|
16
16
|
atomicshop/file_types.py,sha256=-0jzQMRlmU1AP9DARjk-HJm1tVE22E6ngP2mRblyEjY,763
|
|
17
|
-
atomicshop/filesystem.py,sha256=
|
|
17
|
+
atomicshop/filesystem.py,sha256=I72yd_-G1y7aWtD7IzgUQn5BBg8Dpri8o7Jrb_-kfW4,44060
|
|
18
18
|
atomicshop/functions.py,sha256=pK8hoCE9z61PtWCxQJsda7YAphrLH1wxU5x-1QJP-sY,499
|
|
19
19
|
atomicshop/hashing.py,sha256=Le8qGFyt3_wX-zGTeQShz7L2HL_b6nVv9PnawjglyHo,3474
|
|
20
20
|
atomicshop/http_parse.py,sha256=nrf2rZcprLqtW8HVrV7TCZ1iTBcWRRy-mXIlAOzcaJs,9703
|
|
@@ -38,7 +38,7 @@ atomicshop/speech_recognize.py,sha256=55-dIjgkpF93mvJnJuxSFuft5H5eRvGNlUj9BeIOZx
|
|
|
38
38
|
atomicshop/ssh_remote.py,sha256=Sas3nrQv8ardxR51t59xZZsYm8nvUcA7tMSqEDViRLk,17155
|
|
39
39
|
atomicshop/sys_functions.py,sha256=MTBxRve5bh58SPvhX3gMiGqHlSBuI_rdNN1NnnBBWqI,906
|
|
40
40
|
atomicshop/system_resource_monitor.py,sha256=ilA3wEUJfBjQhRsHDXGH7Q05mYr5KarPjRWP8S6pCTw,13681
|
|
41
|
-
atomicshop/system_resources.py,sha256=
|
|
41
|
+
atomicshop/system_resources.py,sha256=0mhDZBEcMzToCOw5ArJhtqYjktOW6iJGdyRkJ01Cpwk,9272
|
|
42
42
|
atomicshop/tempfiles.py,sha256=uq1ve2WlWehZ3NOTXJnpBBMt6HyCdBufqedF0HyzA6k,2517
|
|
43
43
|
atomicshop/timer.py,sha256=KxBBgVM8po6pUJDW8TgY1UXj0iiDmRmL5XDCq0VHAfU,1670
|
|
44
44
|
atomicshop/urls.py,sha256=CQl1j1kjEVDlAuYJqYD9XxPF1SUSgrmG8PjlcXNEKsQ,597
|
|
@@ -99,7 +99,7 @@ atomicshop/etw/dns_trace.py,sha256=RaREpwJETAMZSd1Lhbg0sO3ugBMw3y1fSKdvP5NfTqM,5
|
|
|
99
99
|
atomicshop/etw/etw.py,sha256=xVJNbfCq4KgRfsDnul6CrIdAMl9xRBixZ-hUyqiB2g4,2403
|
|
100
100
|
atomicshop/file_io/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
101
101
|
atomicshop/file_io/csvs.py,sha256=4R4Kij8FmxNwXFjDtlF_A0flAk0Hj5nZKlEnqC5VxgQ,3125
|
|
102
|
-
atomicshop/file_io/docxs.py,sha256=
|
|
102
|
+
atomicshop/file_io/docxs.py,sha256=6tcYFGp0vRsHR47VwcRqwhdt2DQOwrAUYhrwN996n9U,5117
|
|
103
103
|
atomicshop/file_io/file_io.py,sha256=FR84ihjGlr7Eqejo-_js4nBICVst31axD0bwX19S2eM,6385
|
|
104
104
|
atomicshop/file_io/jsons.py,sha256=q9ZU8slBKnHLrtn3TnbK1qxrRpj5ZvCm6AlsFzoANjo,5303
|
|
105
105
|
atomicshop/file_io/tomls.py,sha256=oa0Wm8yMkPRXKN9jgBuTnKbioSOee4mABW5IMUFCYyU,3041
|
|
@@ -233,8 +233,8 @@ atomicshop/wrappers/socketw/socket_server_tester.py,sha256=AhpurHJmP2kgzHaUbq5ey
|
|
|
233
233
|
atomicshop/wrappers/socketw/socket_wrapper.py,sha256=aXBwlEIJhFT0-c4i8iNlFx2It9VpCEpsv--5Oqcpxao,11624
|
|
234
234
|
atomicshop/wrappers/socketw/ssl_base.py,sha256=k4V3gwkbq10MvOH4btU4onLX2GNOsSfUAdcHmL1rpVE,2274
|
|
235
235
|
atomicshop/wrappers/socketw/statistics_csv.py,sha256=t3dtDEfN47CfYVi0CW6Kc2QHTEeZVyYhc57IYYh5nmA,826
|
|
236
|
-
atomicshop-2.10.
|
|
237
|
-
atomicshop-2.10.
|
|
238
|
-
atomicshop-2.10.
|
|
239
|
-
atomicshop-2.10.
|
|
240
|
-
atomicshop-2.10.
|
|
236
|
+
atomicshop-2.10.7.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
|
|
237
|
+
atomicshop-2.10.7.dist-info/METADATA,sha256=iboHlPrXHVtxrbtYEmsI8cSmksF9NFfUF8_A2qX90Gc,10423
|
|
238
|
+
atomicshop-2.10.7.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
239
|
+
atomicshop-2.10.7.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
|
|
240
|
+
atomicshop-2.10.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|