ae-base 0.3.49__py3-none-any.whl → 0.3.50__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
@@ -160,7 +160,7 @@ from types import ModuleType
160
160
  from typing import Any, Callable, Dict, Generator, Iterable, List, Optional, Tuple, Union, cast
161
161
 
162
162
 
163
- __version__ = '0.3.49'
163
+ __version__ = '0.3.50'
164
164
 
165
165
 
166
166
  os_path_abspath = os.path.abspath
@@ -1066,15 +1066,17 @@ def sys_env_dict() -> Dict[str, Any]:
1066
1066
  .. hint:: see also https://pyinstaller.readthedocs.io/en/stable/runtime-information.html
1067
1067
  """
1068
1068
  sed: Dict[str, Any] = {
1069
- 'python_ver': sys.version.replace('\n', ' '),
1069
+ 'python ver': sys.version.replace('\n', ' '),
1070
1070
  'platform': os_platform,
1071
1071
  'argv': sys.argv,
1072
1072
  'executable': sys.executable,
1073
1073
  'cwd': os.getcwd(),
1074
1074
  'frozen': getattr(sys, 'frozen', False),
1075
- 'user_name': os_user_name(),
1076
- 'host_name': os_host_name(),
1075
+ 'user name': os_user_name(),
1076
+ 'host name': os_host_name(),
1077
+ 'device id': os_device_id,
1077
1078
  'app_name_guess': app_name_guess(),
1079
+ 'os env': os.environ.copy(),
1078
1080
  }
1079
1081
 
1080
1082
  if sed['frozen']:
@@ -1220,7 +1222,39 @@ class ErrorMsgMixin:
1220
1222
  self._err_msg = ""
1221
1223
 
1222
1224
 
1223
- if os_platform == 'android': # pragma: no cover
1225
+ # platform-specific patches
1226
+ os_device_id = os_host_name()
1227
+ """ user-definable id/name of the device, defaults to os_host_name() on most platforms, alternatives are:
1228
+
1229
+ on all platforms:
1230
+ - socket.gethostname()
1231
+ on Android (check with adb shell 'settings get global device_name' and adb shell 'settings list global'):
1232
+ - Settings.Global.DEVICE_NAME (Settings.Global.getString(context.getContentResolver(), "device_name"))
1233
+ - android.os.Build.DEVICE/.MANUFACTURER/.BRAND/.HOST
1234
+ - DeviceName.getDeviceName()
1235
+ on MS Windows:
1236
+ - os.environ['COMPUTERNAME']
1237
+ """
1238
+ if os_platform == 'android': # pragma: no cover
1239
+ # determine Android device id because os_host_name() returns mostly 'localhost' and not the user-definable device id
1240
+ from jnius import autoclass # type: ignore
1241
+
1242
+ # noinspection PyBroadException
1243
+ try:
1244
+ Settings = autoclass('android.provider.Settings$Global')
1245
+ PythonActivity = autoclass('org.kivy.android.PythonActivity')
1246
+
1247
+ # mActivity inherits from Context so no need to cast('android.content.Context',..) neither get app context
1248
+ # _Context = autoclass('android.content.Context')
1249
+ # context = cast('android.content.Context', PythonActivity.mActivity)
1250
+ # context = PythonActivity.mActivity.getApplicationContext()
1251
+ context = PythonActivity.mActivity
1252
+ if _dev_id := Settings.getString(context.getContentResolver(), 'device_name'):
1253
+ os_device_id = defuse(_dev_id)
1254
+
1255
+ except Exception:
1256
+ pass
1257
+
1224
1258
  # monkey patch the :func:`shutil.copystat` and :func:`shutil.copymode` helper functions, which are crashing on
1225
1259
  # 'android' (see # `<https://bugs.python.org/issue28141>`__ and `<https://bugs.python.org/issue32073>`__). these
1226
1260
  # functions are used by shutil.copy2/copy/copytree/move to copy OS-specific file attributes.
@@ -1229,3 +1263,8 @@ if os_platform == 'android': # pragma: no cov
1229
1263
  # on the destination root directory.
1230
1264
  shutil.copymode = dummy_function
1231
1265
  shutil.copystat = dummy_function
1266
+
1267
+
1268
+ elif os_platform in ('win32', 'cygwin'): # pragma: no cover
1269
+ if _dev_id := os.environ.get('COMPUTERNAME'):
1270
+ os_device_id = defuse(_dev_id)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ae_base
3
- Version: 0.3.49
3
+ Version: 0.3.50
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
@@ -68,17 +68,17 @@ Dynamic: summary
68
68
 
69
69
  <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae V0.3.95 -->
70
70
  <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.tpl_namespace_root V0.3.14 -->
71
- # base 0.3.49
71
+ # base 0.3.50
72
72
 
73
73
  [![GitLab develop](https://img.shields.io/gitlab/pipeline/ae-group/ae_base/develop?logo=python)](
74
74
  https://gitlab.com/ae-group/ae_base)
75
75
  [![LatestPyPIrelease](
76
- https://img.shields.io/gitlab/pipeline/ae-group/ae_base/release0.3.48?logo=python)](
77
- https://gitlab.com/ae-group/ae_base/-/tree/release0.3.48)
76
+ https://img.shields.io/gitlab/pipeline/ae-group/ae_base/release0.3.49?logo=python)](
77
+ https://gitlab.com/ae-group/ae_base/-/tree/release0.3.49)
78
78
  [![PyPIVersions](https://img.shields.io/pypi/v/ae_base)](
79
79
  https://pypi.org/project/ae-base/#history)
80
80
 
81
- >ae_base module 0.3.49.
81
+ >ae_base module 0.3.50.
82
82
 
83
83
  [![Coverage](https://ae-group.gitlab.io/ae_base/coverage.svg)](
84
84
  https://ae-group.gitlab.io/ae_base/coverage/index.html)
@@ -0,0 +1,7 @@
1
+ ae/base.py,sha256=1me3TvKdrXFKVDI9qqXYzJ52d0d3qVw21rY643gymY0,62992
2
+ ae_base-0.3.50.dist-info/LICENSE.md,sha256=uoIIfORuk4V8ZeNh6SN0EUhiU79RC-indIMFqePKVhY,35002
3
+ ae_base-0.3.50.dist-info/METADATA,sha256=1YUr5FieYlbsSE_1atpH6N0uJmYfTRd4tcpxrtqmJRQ,5636
4
+ ae_base-0.3.50.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
5
+ ae_base-0.3.50.dist-info/top_level.txt,sha256=vUdgAslSmhZLXWU48fm8AG2BjVnkOWLco8rzuW-5zY0,3
6
+ ae_base-0.3.50.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
7
+ ae_base-0.3.50.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (75.8.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,7 +0,0 @@
1
- ae/base.py,sha256=V0wU87UunINFILcnar0HlBvF6gB8nLnj1tfQ-uXoCiY,61257
2
- ae_base-0.3.49.dist-info/LICENSE.md,sha256=uoIIfORuk4V8ZeNh6SN0EUhiU79RC-indIMFqePKVhY,35002
3
- ae_base-0.3.49.dist-info/METADATA,sha256=Ezl-iNQcsr9r0ssjPJAVgVTvZcQZDbHIqno7of0zTos,5636
4
- ae_base-0.3.49.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
5
- ae_base-0.3.49.dist-info/top_level.txt,sha256=vUdgAslSmhZLXWU48fm8AG2BjVnkOWLco8rzuW-5zY0,3
6
- ae_base-0.3.49.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
7
- ae_base-0.3.49.dist-info/RECORD,,