mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-11-02 02:42:04 +00:00
Fix formatting, linting, and logic errors from codebase scan
- Apply black formatting to 17 files. - Fix F821 undefined name errors in: - src/main.py: Add missing `queue` import. - src/seedpass/core/encryption.py: Fix `JSONDecodeError` reference. - src/utils/__init__.py: Fix exception variable scope in fallback code. - src/utils/key_derivation.py: Add `TYPE_CHECKING` imports. - src/seedpass/core/config_manager.py: Add `TYPE_CHECKING` imports. - Initialize torch environment and TODO file. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
c6560305a9
commit
8e33f9c5e1
24 files changed
+207
-22
No files matched your search
@@ -40,14 +40,15 @@ from .atomic_write import atomic_write
|
||||
try: # pragma: no cover - exercised when dependency missing
|
||||
from .clipboard import ClipboardUnavailableError, copy_to_clipboard
|
||||
except Exception as exc: # pragma: no cover - executed only if pyperclip missing
|
||||
_error_msg = str(exc)
|
||||
|
||||
class ClipboardUnavailableError(RuntimeError):
|
||||
"""Stub exception when clipboard support is unavailable."""
|
||||
|
||||
def copy_to_clipboard(*_args, **_kwargs):
|
||||
"""Stub when clipboard support is unavailable."""
|
||||
logger.warning("Clipboard support unavailable: %s", exc)
|
||||
raise ClipboardUnavailableError(str(exc))
|
||||
logger.warning("Clipboard support unavailable: %s", _error_msg)
|
||||
raise ClipboardUnavailableError(_error_msg)
|
||||
|
||||
|
||||
__all__ = [
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
from termcolor import colored
|
||||
|
||||
|
||||
# ANSI escape for 256-color orange (color code 208)
|
||||
_ORANGE = "\033[38;5;208m"
|
||||
_RESET = "\033[0m"
|
||||
|
||||
@@ -21,7 +21,7 @@ import hmac
|
||||
import time
|
||||
from dataclasses import dataclass, field
|
||||
from enum import Enum
|
||||
from typing import Optional, Union, Dict, Any
|
||||
from typing import Optional, Union, Dict, Any, TYPE_CHECKING
|
||||
|
||||
from bip_utils import Bip39SeedGenerator
|
||||
from local_bip85 import BIP85
|
||||
@@ -46,6 +46,9 @@ DEFAULT_ENCRYPTION_MODE = EncryptionMode.SEED_ONLY
|
||||
# Purpose constant for TOTP secret derivation using BIP85
|
||||
TOTP_PURPOSE = 39
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from seedpass.core.config_manager import ConfigManager
|
||||
|
||||
|
||||
@dataclass
|
||||
class KdfConfig:
|
||||
|
||||
@@ -17,7 +17,6 @@ except ImportError: # pragma: no cover - POSIX only
|
||||
from utils.terminal_utils import clear_screen
|
||||
from utils.logging_utils import pause_console_logging, resume_console_logging
|
||||
|
||||
|
||||
DEFAULT_MAX_ATTEMPTS = 5
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user