mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-09 15:58:48 +00:00
Avoid eager imports to fix circular dependency
This commit is contained in:
@@ -1,21 +1,16 @@
|
||||
# nostr/__init__.py
|
||||
|
||||
import logging
|
||||
import traceback
|
||||
from .client import NostrClient
|
||||
"""Nostr package exposing :class:`NostrClient` lazily."""
|
||||
|
||||
from importlib import import_module
|
||||
import logging
|
||||
|
||||
# Instantiate the logger
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Initialize the logger for this module
|
||||
logger = logging.getLogger(__name__) # Correct logger initialization
|
||||
|
||||
try:
|
||||
from .client import NostrClient
|
||||
|
||||
logger.info("NostrClient module imported successfully.")
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to import NostrClient module: {e}")
|
||||
logger.error(traceback.format_exc()) # Log full traceback
|
||||
|
||||
__all__ = ["NostrClient"]
|
||||
|
||||
|
||||
def __getattr__(name: str):
|
||||
if name == "NostrClient":
|
||||
return import_module(".client", __name__).NostrClient
|
||||
raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
|
||||
|
Reference in New Issue
Block a user