Fix linting
This commit is contained in:
@@ -8,7 +8,6 @@ from typing import Optional, List, Tuple
|
|||||||
import sys
|
import sys
|
||||||
from ascii_colors import ASCIIColors
|
from ascii_colors import ASCIIColors
|
||||||
import logging
|
import logging
|
||||||
from ascii_colors import ASCIIColors
|
|
||||||
from lightrag.api import __api_version__
|
from lightrag.api import __api_version__
|
||||||
from fastapi import HTTPException, Security, Request, status
|
from fastapi import HTTPException, Security, Request, status
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
@@ -17,15 +16,18 @@ from starlette.status import HTTP_403_FORBIDDEN
|
|||||||
from .auth import auth_handler
|
from .auth import auth_handler
|
||||||
from ..prompt import PROMPTS
|
from ..prompt import PROMPTS
|
||||||
|
|
||||||
|
|
||||||
def check_env_file():
|
def check_env_file():
|
||||||
"""
|
"""
|
||||||
Check if .env file exists and handle user confirmation if needed.
|
Check if .env file exists and handle user confirmation if needed.
|
||||||
Returns True if should continue, False if should exit.
|
Returns True if should continue, False if should exit.
|
||||||
"""
|
"""
|
||||||
if not os.path.exists(".env"):
|
if not os.path.exists(".env"):
|
||||||
warning_msg = "Warning: .env file not found. Some features may not work properly."
|
warning_msg = (
|
||||||
|
"Warning: .env file not found. Some features may not work properly."
|
||||||
|
)
|
||||||
ASCIIColors.yellow(warning_msg)
|
ASCIIColors.yellow(warning_msg)
|
||||||
|
|
||||||
# Check if running in interactive terminal
|
# Check if running in interactive terminal
|
||||||
if sys.stdin.isatty():
|
if sys.stdin.isatty():
|
||||||
response = input("Do you want to continue? (yes/no): ")
|
response = input("Do you want to continue? (yes/no): ")
|
||||||
@@ -34,6 +36,7 @@ def check_env_file():
|
|||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
# Load environment variables
|
# Load environment variables
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
|
@@ -75,7 +75,12 @@ class LightragPathFilter(logging.Filter):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
# Define paths to be filtered
|
# Define paths to be filtered
|
||||||
self.filtered_paths = ["/documents", "/health", "/webui/", "/documents/pipeline_status"]
|
self.filtered_paths = [
|
||||||
|
"/documents",
|
||||||
|
"/health",
|
||||||
|
"/webui/",
|
||||||
|
"/documents/pipeline_status",
|
||||||
|
]
|
||||||
# self.filtered_paths = ["/health", "/webui/"]
|
# self.filtered_paths = ["/health", "/webui/"]
|
||||||
|
|
||||||
def filter(self, record):
|
def filter(self, record):
|
||||||
|
Reference in New Issue
Block a user