refactor: remove environment variable imports from auth module
- Remove os, dotenv, and pathlib imports - Remove module-level environment setup code - Prepare for pure function implementation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,25 +2,8 @@
|
||||
Authentication module - Responsible for Yonyou BIP system login and logout operations
|
||||
"""
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
from playwright.sync_api import Playwright, Browser, BrowserContext, Page, Frame
|
||||
|
||||
# Load environment variables
|
||||
from dotenv import load_dotenv
|
||||
|
||||
# Get project root directory
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
|
||||
# Load .env file
|
||||
env_path = BASE_DIR / ".env"
|
||||
load_dotenv(env_path)
|
||||
|
||||
# Configure Playwright browser path
|
||||
browsers_path = os.getenv("PLAYWRIGHT_BROWSERS_PATH")
|
||||
if browsers_path:
|
||||
os.environ["PLAYWRIGHT_BROWSERS_PATH"] = browsers_path
|
||||
|
||||
|
||||
def login(
|
||||
playwright: Playwright,
|
||||
|
||||
Reference in New Issue
Block a user