atomicshop 2.10.6__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 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__ = '2.10.6'
4
+ __version__ = '2.10.7'
@@ -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 empty or opened in Word: {docx_path}", color="red", error_type=True)
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="*.docx",
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
- for found_file in found_in_files:
121
- print(found_file)
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('press Enter')
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'.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: atomicshop
3
- Version: 2.10.6
3
+ Version: 2.10.7
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=tFi0pykEUI0rTZZH1Vg6SdcRfzQTZKkiN45riWXH6hE,123
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=FFOEUZygGvPrIdedq4DVaXhMX2YFaFovB2xhDVMCgM4,43813
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
@@ -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=3IFtaurVhvntcuCL59bpFlzGyKxvDmVUjUQTHWluOMY,4369
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.6.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
237
- atomicshop-2.10.6.dist-info/METADATA,sha256=mwost6XyCI5vs7r3uag442WjE7EudZ3K8Hp429Wj9fs,10423
238
- atomicshop-2.10.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
239
- atomicshop-2.10.6.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
240
- atomicshop-2.10.6.dist-info/RECORD,,
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,,