abstract-utilities 0.2.2.679__py3-none-any.whl → 0.2.2.691__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 abstract-utilities might be problematic. Click here for more details.
- abstract_utilities/import_utils/src/import_utils.py +36 -16
- {abstract_utilities-0.2.2.679.dist-info → abstract_utilities-0.2.2.691.dist-info}/METADATA +1 -1
- {abstract_utilities-0.2.2.679.dist-info → abstract_utilities-0.2.2.691.dist-info}/RECORD +5 -5
- {abstract_utilities-0.2.2.679.dist-info → abstract_utilities-0.2.2.691.dist-info}/WHEEL +0 -0
- {abstract_utilities-0.2.2.679.dist-info → abstract_utilities-0.2.2.691.dist-info}/top_level.txt +0 -0
|
@@ -300,41 +300,61 @@ def attach_self_functions(
|
|
|
300
300
|
def initFuncs(self, mode=None):
|
|
301
301
|
"""
|
|
302
302
|
Load functions in either dev (dynamic) or prod (static) mode.
|
|
303
|
+
Absence of functions folder is a NO-OP.
|
|
303
304
|
"""
|
|
304
305
|
mode = mode or "dev"
|
|
305
|
-
|
|
306
306
|
logger = get_logFile(__name__)
|
|
307
307
|
|
|
308
|
-
|
|
309
|
-
base_pkg = self.__class__.__module__.rsplit('.', 1)[0]
|
|
308
|
+
base_pkg = self.__class__.__module__.rsplit(".", 1)[0]
|
|
310
309
|
|
|
311
|
-
|
|
312
|
-
|
|
310
|
+
# ------------------
|
|
311
|
+
# PROD MODE (STATIC)
|
|
312
|
+
# ------------------
|
|
313
|
+
if mode == "prod":
|
|
314
|
+
try:
|
|
313
315
|
imports_mod = importlib.import_module(f"{base_pkg}.imports.funcs_imports")
|
|
314
|
-
|
|
315
|
-
# Attach all exports
|
|
316
316
|
for name in getattr(imports_mod, "__all__", []):
|
|
317
|
-
|
|
318
|
-
|
|
317
|
+
try:
|
|
318
|
+
func = getattr(imports_mod, name)
|
|
319
|
+
setattr(self, name, func.__get__(self))
|
|
320
|
+
except Exception as e:
|
|
321
|
+
logger.info(f"initFuncs(prod) attach error: {e}")
|
|
322
|
+
except Exception as e:
|
|
323
|
+
logger.info(f"initFuncs(prod) skipped: {e}")
|
|
324
|
+
return self # 🔒 HARD STOP
|
|
319
325
|
|
|
326
|
+
# ------------------
|
|
327
|
+
# DEV MODE (DYNAMIC)
|
|
328
|
+
# ------------------
|
|
329
|
+
import inspect
|
|
330
|
+
import pkgutil
|
|
331
|
+
|
|
332
|
+
try:
|
|
333
|
+
# resolve filesystem path FIRST
|
|
334
|
+
pkg_root = Path(importlib.import_module(base_pkg).__file__).parent
|
|
335
|
+
functions_dir = pkg_root / "functions"
|
|
336
|
+
|
|
337
|
+
# 🚫 no functions folder → silent no-op
|
|
338
|
+
if not functions_dir.exists() or not functions_dir.is_dir():
|
|
320
339
|
return self
|
|
321
340
|
|
|
322
|
-
#
|
|
323
|
-
|
|
324
|
-
|
|
341
|
+
# 🚫 not a package → no-op
|
|
342
|
+
if not (functions_dir / "__init__.py").exists():
|
|
343
|
+
return self
|
|
325
344
|
|
|
326
|
-
|
|
345
|
+
pkg = importlib.import_module(f"{base_pkg}.functions")
|
|
346
|
+
existing = set(dir(self))
|
|
327
347
|
|
|
328
348
|
for _, module_name, _ in pkgutil.iter_modules(pkg.__path__):
|
|
329
349
|
try:
|
|
330
350
|
mod = importlib.import_module(f"{pkg.__name__}.{module_name}")
|
|
331
|
-
|
|
332
351
|
for name, obj in inspect.getmembers(mod, inspect.isfunction):
|
|
333
352
|
if name not in existing:
|
|
334
353
|
setattr(self, name, obj.__get__(self))
|
|
335
354
|
except Exception as e:
|
|
336
|
-
logger.
|
|
355
|
+
logger.info(f"initFuncs(dev) module skipped: {e}")
|
|
356
|
+
|
|
337
357
|
except Exception as e:
|
|
338
|
-
logger.
|
|
358
|
+
logger.info(f"initFuncs(dev) skipped entirely: {e}")
|
|
339
359
|
|
|
340
360
|
return self
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: abstract_utilities
|
|
3
|
-
Version: 0.2.2.
|
|
3
|
+
Version: 0.2.2.691
|
|
4
4
|
Summary: abstract_utilities is a collection of utility modules providing a variety of functions to aid in tasks such as data comparison, list manipulation, JSON handling, string manipulation, mathematical computations, and time operations.
|
|
5
5
|
Home-page: https://github.com/AbstractEndeavors/abstract_utilities
|
|
6
6
|
Author: putkoff
|
|
@@ -160,7 +160,7 @@ abstract_utilities/import_utils/src/clean_imports.py,sha256=awpVFI-DMd8oOtx3JcUi
|
|
|
160
160
|
abstract_utilities/import_utils/src/dot_utils.py,sha256=oahEkVmexO-a2F3DKYQP5IrCvKJi9tjM_rjCImM_KCY,2793
|
|
161
161
|
abstract_utilities/import_utils/src/extract_utils.py,sha256=YuDVWbCKDrVDh9M7aZHdsrEoh_infJ3BUv46J6K-UYg,1705
|
|
162
162
|
abstract_utilities/import_utils/src/import_functions.py,sha256=5GxFh32e-DWDZ5IR-LnQTOiEmv15tjb3Fn_yhgnu7q8,4408
|
|
163
|
-
abstract_utilities/import_utils/src/import_utils.py,sha256=
|
|
163
|
+
abstract_utilities/import_utils/src/import_utils.py,sha256=HvMCYZmZAfcgdfy0a80Z3ZpDc07QKgEtKZ6Zl14i7B0,13947
|
|
164
164
|
abstract_utilities/import_utils/src/nullProxy.py,sha256=pYzP_tBJHduqc8IqdvjtRs1miYSab6NzHYiIqYGpduA,849
|
|
165
165
|
abstract_utilities/import_utils/src/package_utils.py,sha256=9qjBzIApDhV7kOdSRgZA9k-EncBNAg3mZZodgsiUNM4,5861
|
|
166
166
|
abstract_utilities/import_utils/src/pkg_utils.py,sha256=tSLaqFgitwswSuGhv-UnONT3rpri9DjK9ALt_0t5I30,7617
|
|
@@ -282,7 +282,7 @@ abstract_utilities/type_utils/imports/constants.py,sha256=HUCD5R1URZLuG1hHOinDR8
|
|
|
282
282
|
abstract_utilities/type_utils/imports/imports.py,sha256=C_ZAQO-y7R31BYxTuaHJCEQE9IZSU1JgCtdHNWxZKhY,77
|
|
283
283
|
abstract_utilities/type_utils/imports/module_imports.py,sha256=qWWGttKQ1_P_miOGExuen9nvIlSeLBcQ7tzw49G1vhc,707
|
|
284
284
|
imports/__init__.py,sha256=2PSEAwZY88J2NHt98XCO5drFNok5ctiJ8LE02kwABP4,944
|
|
285
|
-
abstract_utilities-0.2.2.
|
|
286
|
-
abstract_utilities-0.2.2.
|
|
287
|
-
abstract_utilities-0.2.2.
|
|
288
|
-
abstract_utilities-0.2.2.
|
|
285
|
+
abstract_utilities-0.2.2.691.dist-info/METADATA,sha256=PhUI5UXXzZlJM8hhcMsaIHszXmlBRgiqSYbAmHzXin8,28108
|
|
286
|
+
abstract_utilities-0.2.2.691.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
287
|
+
abstract_utilities-0.2.2.691.dist-info/top_level.txt,sha256=BF0GZ0xVFfN1K-hFIWPO3viNsOs1sSF86n1vHBg39FM,19
|
|
288
|
+
abstract_utilities-0.2.2.691.dist-info/RECORD,,
|
|
File without changes
|
{abstract_utilities-0.2.2.679.dist-info → abstract_utilities-0.2.2.691.dist-info}/top_level.txt
RENAMED
|
File without changes
|