ae-base 0.3.44__py3-none-any.whl → 0.3.45__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.
ae/base.py CHANGED
@@ -173,7 +173,7 @@ from types import ModuleType
173
173
  from typing import Any, Callable, Dict, Generator, Iterable, List, Optional, Tuple, Union, cast
174
174
 
175
175
 
176
- __version__ = '0.3.44'
176
+ __version__ = '0.3.45'
177
177
 
178
178
 
179
179
  os_path_abspath = os.path.abspath
@@ -363,9 +363,13 @@ ASCII_UNICODE = (
363
363
  ('%', '﹪'), # U+FE6A: Small Percent Sign
364
364
  ('^', '^'), # U+FF3E: Fullwidth Circumflex Accent
365
365
  (',', '﹐'), # U+FE50: Small Comma
366
- (' ', ' '), # U+3000: Ideographic Space; ' ' U+200A Hair Space; ' ' U+2007 Figure Space;
367
- # ' ' U+2009 Thin; ' ' U+2003 Em Space; '' U+2002 En Space; '' U+2008 Punctuation Space
368
- # ' ' U+00A0: No-Break Space (NBSP); '' U+202F: Narrow No-Break Space (NNBSP)
366
+ (' ', ''), # U+2423: Open Box; more see underneath and https://unicode-explorer.com/articles/space-characters:
367
+ # ' ' U+00A0: No-Break Space (NBSP); '?¿?' U+1680 Ogham Space Mark; ' ' U+2000 En Quad;
368
+ # ' ' U+2001 Em Quad; ' ' U+2002 En Space; '' U+2003 Em Space; ' ' U+2004 Three-Per-Em
369
+ # ' ' U+2005 Four-Per-Em; ' ' U+2006 Six-Per-Em; ' ' U+2007 Figure Space;
370
+ # ' ' U+2008 Punctuation Space; ' ' U+2009 Thin; ' ' U+200A Hair Space;
371
+ # ' ' U+202F: Narrow No-Break Space (NNBSP); ' ' U+205F Medium Mathematical Space;
372
+ # '␠' U+2420 symbol for space; '␣' U+2423 Open Box; ' ' U+3000: Ideographic Space
369
373
  (chr(127), '␡'), # U+2421: DELETE SYMBOL
370
374
  # ('_', '𛲖'), # U+1BC96: Duployan Affix Low Line; '_' U+FF3F Fullwidth Low Line
371
375
  )
@@ -1092,7 +1096,8 @@ def utc_datetime() -> datetime.datetime:
1092
1096
  return datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None)
1093
1097
 
1094
1098
 
1095
- def write_file(file_path: str, content: Union[str, bytes], extra_mode: str = "", encoding: Optional[str] = None):
1099
+ def write_file(file_path: str, content: Union[str, bytes],
1100
+ extra_mode: str = "", encoding: Optional[str] = None, make_dirs: bool = False):
1096
1101
  """ (over)write the file specified by :paramref:`~write_file.file_path` with text or binary/bytes content.
1097
1102
 
1098
1103
  :param file_path: file path/name to write the passed content into (overwriting any previous content!).
@@ -1105,6 +1110,8 @@ def write_file(file_path: str, content: Union[str, bytes], extra_mode: str = "",
1105
1110
  be automatically added to the `mode` argument of :func:`open` (if not already specified
1106
1111
  in this argument).
1107
1112
  :param encoding: encoding used to write/convert/interpret the file content to write.
1113
+ :param make_dirs: pass True to automatically create not existing folders specified in
1114
+ :paramref:`~write_file.file_path`.
1108
1115
  :raises FileExistsError: if file exists already and is write-protected.
1109
1116
  :raises FileNotFoundError: if parts of the file path do not exist.
1110
1117
  :raises OSError: if :paramref:`~write_file.file_path` is misspelled or contains invalid characters.
@@ -1120,6 +1127,9 @@ def write_file(file_path: str, content: Union[str, bytes], extra_mode: str = "",
1120
1127
  for an intent result.
1121
1128
  Related german docs: https://developer.android.com/training/data-storage/shared/media?hl=de
1122
1129
  """
1130
+ if make_dirs and (dir_path := os_path_dirname(file_path)):
1131
+ os.makedirs(dir_path, exist_ok=True)
1132
+
1123
1133
  if isinstance(content, bytes) and 'b' not in extra_mode:
1124
1134
  extra_mode += 'b'
1125
1135
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ae_base
3
- Version: 0.3.44
3
+ Version: 0.3.45
4
4
  Summary: ae namespace module portion base: basic constants, helper functions and context manager
5
5
  Home-page: https://gitlab.com/ae-group/ae_base
6
6
  Author: AndiEcker
@@ -55,17 +55,17 @@ Requires-Dist: twine; extra == "tests"
55
55
 
56
56
  <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae V0.3.94 -->
57
57
  <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.tpl_namespace_root V0.3.14 -->
58
- # base 0.3.44
58
+ # base 0.3.45
59
59
 
60
60
  [![GitLab develop](https://img.shields.io/gitlab/pipeline/ae-group/ae_base/develop?logo=python)](
61
61
  https://gitlab.com/ae-group/ae_base)
62
62
  [![LatestPyPIrelease](
63
- https://img.shields.io/gitlab/pipeline/ae-group/ae_base/release0.3.43?logo=python)](
64
- https://gitlab.com/ae-group/ae_base/-/tree/release0.3.43)
63
+ https://img.shields.io/gitlab/pipeline/ae-group/ae_base/release0.3.44?logo=python)](
64
+ https://gitlab.com/ae-group/ae_base/-/tree/release0.3.44)
65
65
  [![PyPIVersions](https://img.shields.io/pypi/v/ae_base)](
66
66
  https://pypi.org/project/ae-base/#history)
67
67
 
68
- >ae_base module 0.3.44.
68
+ >ae_base module 0.3.45.
69
69
 
70
70
  [![Coverage](https://ae-group.gitlab.io/ae_base/coverage.svg)](
71
71
  https://ae-group.gitlab.io/ae_base/coverage/index.html)
@@ -0,0 +1,7 @@
1
+ ae/base.py,sha256=0WGHYbGamleCIv7kJlIBAju9iXC2sgdzoKA__3YPQx8,61646
2
+ ae_base-0.3.45.dist-info/LICENSE.md,sha256=eHVr16LWo8bsm2NbdFOBcQp-F_3MUXo9I922sABpsMQ,35002
3
+ ae_base-0.3.45.dist-info/METADATA,sha256=hBVAUNOZLwa2hwgxvDmPSdrNdIBvJpI8zuE3Cj2moeA,5311
4
+ ae_base-0.3.45.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
5
+ ae_base-0.3.45.dist-info/top_level.txt,sha256=vUdgAslSmhZLXWU48fm8AG2BjVnkOWLco8rzuW-5zY0,3
6
+ ae_base-0.3.45.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
7
+ ae_base-0.3.45.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.3.0)
2
+ Generator: setuptools (75.5.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,7 +0,0 @@
1
- ae/base.py,sha256=QByzHC7yJb-vSrTfX0C1U5AQsQK0J105ZiclDnJTMzs,60890
2
- ae_base-0.3.44.dist-info/LICENSE.md,sha256=eHVr16LWo8bsm2NbdFOBcQp-F_3MUXo9I922sABpsMQ,35002
3
- ae_base-0.3.44.dist-info/METADATA,sha256=x5tlK4rJO-YdGoCtz1OyaELmV0k4CqBt3UHiZdo9TEQ,5311
4
- ae_base-0.3.44.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
5
- ae_base-0.3.44.dist-info/top_level.txt,sha256=vUdgAslSmhZLXWU48fm8AG2BjVnkOWLco8rzuW-5zY0,3
6
- ae_base-0.3.44.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
7
- ae_base-0.3.44.dist-info/RECORD,,