updating db logic adding logging
This commit is contained in:
24
web/utils.py
24
web/utils.py
@@ -93,9 +93,6 @@ def get_paths() -> dict:
|
||||
return get_config().get('paths', {})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def get_logs_dir() -> str:
|
||||
return get_paths().get('logs_dir', 'logs')
|
||||
|
||||
@@ -128,9 +125,6 @@ def get_base_url() -> str:
|
||||
return get_config().get('scraper', {}).get('base_url', "https://{region}.craigslist.org/search/jjj?query={keyword}&sort=rel")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def now_iso() -> str:
|
||||
"""Get the current time in ISO format."""
|
||||
return datetime.now(UTC).isoformat()
|
||||
@@ -170,9 +164,6 @@ def get_url_from_filename(name: str) -> str:
|
||||
return url_guess
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def safe_get_text(element, default="N/A"):
|
||||
"""Safely extract text from BeautifulSoup element."""
|
||||
return element.get_text(strip=True) if element else default
|
||||
@@ -188,21 +179,6 @@ def get_random_delay(min_delay: int = get_min_delay(), max_delay: int = get_max_
|
||||
return random.uniform(min_delay, max_delay)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def get_color_from_string(s: str) -> str:
|
||||
"""Generate a color code from a string."""
|
||||
hash_code = hash(s)
|
||||
|
||||
Reference in New Issue
Block a user