Fix : setup.py for browser requirement

This commit is contained in:
martin legrand
2025-03-13 14:48:02 +01:00
parent 6b2c773ebb
commit 0315d8e67f
4 changed files with 17 additions and 6 deletions
+2 -2
View File
@@ -9,6 +9,7 @@ import time
from bs4 import BeautifulSoup
import markdownify
import logging
import sys
class Browser:
def __init__(self, headless=False):
@@ -24,7 +25,6 @@ class Browser:
self.wait = WebDriverWait(self.driver, 10)
self.logger = logging.getLogger(__name__)
self.logger.info("Browser initialized successfully")
except Exception as e:
raise Exception(f"Failed to initialize browser: {str(e)}")
@@ -136,7 +136,7 @@ class Browser:
self.driver.quit()
self.logger.info("Browser closed")
except Exception as e:
self.logger.error(f"Error closing browser: {str(e)}")
raise e
def __del__(self):
"""Destructor to ensure browser is closed."""
+2 -2
View File
@@ -1,5 +1,4 @@
from colorama import Fore
import pyaudio
import queue
import threading
import numpy as np
@@ -15,7 +14,8 @@ class AudioRecorder:
"""
AudioRecorder is a class that records audio from the microphone and adds it to the audio queue.
"""
def __init__(self, format: int = pyaudio.paInt16, channels: int = 1, rate: int = 4096, chunk: int = 8192, record_seconds: int = 5, verbose: bool = False):
def __init__(self, format: int, channels: int = 1, rate: int = 4096, chunk: int = 8192, record_seconds: int = 5, verbose: bool = False):
import pyaudio
self.format = format
self.channels = channels
self.rate = rate