ae-base 0.3.61__py3-none-any.whl → 0.3.64__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
@@ -171,7 +171,7 @@ from types import ModuleType
171
171
  from typing import Any, Callable, Generator, Iterable, MutableMapping, Optional, Union, cast
172
172
 
173
173
 
174
- __version__ = '0.3.61'
174
+ __version__ = '0.3.64'
175
175
 
176
176
 
177
177
  os_path_abspath = os.path.abspath
@@ -641,7 +641,7 @@ def load_dotenvs():
641
641
  load_env_var_defaults(os_path_dirname(os_path_abspath(file_name)), env_vars)
642
642
 
643
643
 
644
- def load_env_var_defaults(start_dir: str, env_vars: MutableMapping[str, str]):
644
+ def load_env_var_defaults(start_dir: str, env_vars: MutableMapping[str, str]) -> MutableMapping[str, str]:
645
645
  """ load undeclared env var defaults from a chain of ``.env`` files starting in the specified folder or its parent.
646
646
 
647
647
  :param start_dir: folder to start search of an ``.env`` file, if not found, then also checks the parent
@@ -653,21 +653,25 @@ def load_env_var_defaults(start_dir: str, env_vars: MutableMapping[str, str]):
653
653
  :param env_vars: environment variables mapping to be amended with env variable values from any
654
654
  found ``.env`` file. pass Python's :data:`os.environ` to amend this mapping directly
655
655
  with all the already not declared environment variables.
656
+ :return: dict with the loaded env var names (keys) and values.
656
657
  """
657
658
  start_dir = norm_path(start_dir)
658
659
  file_path = os_path_join(start_dir, DOTENV_FILE_NAME)
659
660
  if not os_path_isfile(file_path):
660
661
  file_path = os_path_join(os_path_dirname(start_dir), DOTENV_FILE_NAME)
661
662
 
663
+ loaded_vars = {}
662
664
  while os_path_isfile(file_path):
663
665
  for var_nam, var_val in parse_dotenv(file_path).items():
664
666
  if var_nam not in env_vars:
665
- env_vars[var_nam] = var_val
667
+ env_vars[var_nam] = loaded_vars[var_nam] = var_val
666
668
 
667
669
  if os.sep not in file_path:
668
670
  break # pragma: no cover # prevent endless-loop for ``.env`` file in root dir (os.sep == '/')
669
671
  file_path = os_path_join(os_path_dirname(os_path_dirname(file_path)), DOTENV_FILE_NAME)
670
672
 
673
+ return loaded_vars
674
+
671
675
 
672
676
  def main_file_paths_parts(portion_name: str) -> tuple[tuple[str, ...], ...]:
673
677
  """ determine tuple of supported main/version file name path part tuples.
@@ -1245,30 +1249,25 @@ def write_file(file_path: str, content: Union[str, bytes],
1245
1249
  class ErrorMsgMixin: # pylint: disable=too-few-public-methods
1246
1250
  """ mixin class providing sophisticated error message handling. """
1247
1251
  _err_msg: str = ""
1248
-
1249
- cae = None
1250
- po = print
1251
- dpo = print
1252
- vpo = print
1252
+ main_app = None
1253
+ po = dpo = vpo = print
1253
1254
 
1254
1255
  def __init__(self):
1255
1256
  try:
1256
1257
  from ae.core import main_app_instance # type: ignore # pylint: disable=import-outside-toplevel
1257
1258
 
1258
- self.cae = cae = main_app_instance()
1259
- assert cae is not None, f"{self.__class__.__name__}.__init__() called too early; main app instance not"
1259
+ self.main_app = main_app = main_app_instance()
1260
+ assert main_app is not None, f"{self.__class__.__name__}.__init__() called too early; main app instance not"
1260
1261
 
1261
- self.po = cae.po
1262
- self.dpo = cae.dpo
1263
- self.vpo = cae.vpo
1262
+ self.po = main_app.po
1263
+ self.dpo = main_app.dpo
1264
+ self.vpo = main_app.vpo
1264
1265
 
1265
1266
  except (ImportError, AssertionError, Exception) as exc: # pylint: disable=broad-except
1266
1267
  print(f"{self.__class__.__name__}.__init__() raised {exc}; using print() instead of main app error loggers")
1267
1268
 
1268
- # self.cae = None
1269
- # self.po = print
1270
- # self.dpo = print
1271
- # self.vpo = print
1269
+ # self.main_app = None
1270
+ # self.po = self.dpo = self.vpo = print
1272
1271
 
1273
1272
  @property
1274
1273
  def error_message(self) -> str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ae_base
3
- Version: 0.3.61
3
+ Version: 0.3.64
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
@@ -69,13 +69,13 @@ Dynamic: summary
69
69
 
70
70
  <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae V0.3.96 -->
71
71
  <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.tpl_namespace_root V0.3.14 -->
72
- # base 0.3.61
72
+ # base 0.3.64
73
73
 
74
74
  [![GitLab develop](https://img.shields.io/gitlab/pipeline/ae-group/ae_base/develop?logo=python)](
75
75
  https://gitlab.com/ae-group/ae_base)
76
76
  [![LatestPyPIrelease](
77
- https://img.shields.io/gitlab/pipeline/ae-group/ae_base/release0.3.60?logo=python)](
78
- https://gitlab.com/ae-group/ae_base/-/tree/release0.3.60)
77
+ https://img.shields.io/gitlab/pipeline/ae-group/ae_base/release0.3.63?logo=python)](
78
+ https://gitlab.com/ae-group/ae_base/-/tree/release0.3.63)
79
79
  [![PyPIVersions](https://img.shields.io/pypi/v/ae_base)](
80
80
  https://pypi.org/project/ae-base/#history)
81
81
 
@@ -0,0 +1,7 @@
1
+ ae/base.py,sha256=STUdNRroIq5IXtXCqWRg8vIu-Vx-qvOT8f7gnv8uhH8,67812
2
+ ae_base-0.3.64.dist-info/licenses/LICENSE.md,sha256=vn9XT8MDUxNAWsP60HLwHJp8ZLOI0OJBRe-1N2xXh08,35002
3
+ ae_base-0.3.64.dist-info/METADATA,sha256=Yo8TxzMWNjmhRMgJwKFsXW3Ui6M9IA358AIO1abx4mE,5724
4
+ ae_base-0.3.64.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
5
+ ae_base-0.3.64.dist-info/top_level.txt,sha256=vUdgAslSmhZLXWU48fm8AG2BjVnkOWLco8rzuW-5zY0,3
6
+ ae_base-0.3.64.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
7
+ ae_base-0.3.64.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- ae/base.py,sha256=RlIALdehqSfXnfsAQO08ZQditIvM7lhhoq6nxI207W0,67651
2
- ae_base-0.3.61.dist-info/licenses/LICENSE.md,sha256=vn9XT8MDUxNAWsP60HLwHJp8ZLOI0OJBRe-1N2xXh08,35002
3
- ae_base-0.3.61.dist-info/METADATA,sha256=yrc326HYYiuFYCWc13w5RIabiR_fJnLCW1VtnyEGblU,5724
4
- ae_base-0.3.61.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
5
- ae_base-0.3.61.dist-info/top_level.txt,sha256=vUdgAslSmhZLXWU48fm8AG2BjVnkOWLco8rzuW-5zY0,3
6
- ae_base-0.3.61.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
7
- ae_base-0.3.61.dist-info/RECORD,,