refactor(paths): replace 26 modules hardcoded ~/.pry/ with PRY_DATA_DIR
Each module did:
X_DIR = Path(os.path.expanduser("~/.pry/x"))
After:
from paths import PRY_DATA_DIR
X_DIR = PRY_DATA_DIR / "x"
The module-level Path construction is preserved, so the rest of the
code is unchanged. PRY_DATA_DIR is read once at import (overridable via
the env var of the same name).
Verified:
- 407 tests collect (was 5 collection errors from a misplaced import)
- 83 sampled tests pass (intelligence, proxy_manager, x402, agency,
gdpr, referrals, marketplace, api)
- 0 remaining hardcoded ~/.pry references in .py files
Follow-up: paths.py adds subdir(name) helper for new code that wants
auto-mkdir; existing modules still call .mkdir(exist_ok=True) themselves
to preserve the eager-init behavior they had before.
This commit is contained in:
parent
c2c33c4d9f
commit
dd63022530
26 changed files with 53 additions and 28 deletions
|
|
@ -1,6 +1,7 @@
|
|||
"""Pry — Proxy Manager with affiliate-signup flow.
|
||||
Tries free proxies first (Tor, public rotating). When premium proxy is needed,
|
||||
prompts user to sign up via affiliate links. Pre-wired to 5+ providers."""
|
||||
from paths import PRY_DATA_DIR
|
||||
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Copyright (c) 2026 Rug Munch Media LLC
|
||||
|
|
@ -24,7 +25,7 @@ try:
|
|||
except ImportError: # proxy_referrals module not always present in slim installs
|
||||
_PROXY_REFERRALS = {}
|
||||
|
||||
PROXY_DIR = Path(os.path.expanduser("~/.pry/proxies"))
|
||||
PROXY_DIR = PRY_DATA_DIR / "proxies"
|
||||
PROXY_DIR.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# Free proxy sources (no signup required)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue