refactor: remove close_session() function
- Remove close_session() wrapper function entirely - Callers now directly manage browser/context lifecycle - Reduces module to pure authentication functions only Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -124,21 +124,3 @@ def logout(main_frame: Frame, verbose: bool = True) -> None:
|
||||
print("Confirmation dialog not found, may have auto-logged out")
|
||||
|
||||
time.sleep(2) # Wait for logout to complete
|
||||
|
||||
|
||||
def close_session(browser: Browser, context: BrowserContext) -> None:
|
||||
"""
|
||||
Close browser session
|
||||
|
||||
Args:
|
||||
browser: Browser instance
|
||||
context: Browser context
|
||||
"""
|
||||
# Check if auto-close browser is enabled
|
||||
auto_close = os.getenv("ERP_AUTO_CLOSE_BROWSER", "true").lower() in ("true", "1", "yes")
|
||||
|
||||
if auto_close:
|
||||
context.close()
|
||||
browser.close()
|
||||
else:
|
||||
print("Note: Browser not auto-closed (ERP_AUTO_CLOSE_BROWSER=false)")
|
||||
|
||||
Reference in New Issue
Block a user