yangdx commited on
Commit
f72e905
·
1 Parent(s): 3726d89

Fix linting

Browse files
Files changed (2) hide show
  1. lightrag/api/utils_api.py +6 -3
  2. lightrag/utils.py +6 -1
lightrag/api/utils_api.py CHANGED
@@ -8,7 +8,6 @@ from typing import Optional, List, Tuple
8
  import sys
9
  from ascii_colors import ASCIIColors
10
  import logging
11
- from ascii_colors import ASCIIColors
12
  from lightrag.api import __api_version__
13
  from fastapi import HTTPException, Security, Request, status
14
  from dotenv import load_dotenv
@@ -17,15 +16,18 @@ from starlette.status import HTTP_403_FORBIDDEN
17
  from .auth import auth_handler
18
  from ..prompt import PROMPTS
19
 
 
20
  def check_env_file():
21
  """
22
  Check if .env file exists and handle user confirmation if needed.
23
  Returns True if should continue, False if should exit.
24
  """
25
  if not os.path.exists(".env"):
26
- warning_msg = "Warning: .env file not found. Some features may not work properly."
 
 
27
  ASCIIColors.yellow(warning_msg)
28
-
29
  # Check if running in interactive terminal
30
  if sys.stdin.isatty():
31
  response = input("Do you want to continue? (yes/no): ")
@@ -34,6 +36,7 @@ def check_env_file():
34
  return False
35
  return True
36
 
 
37
  # Load environment variables
38
  load_dotenv()
39
 
 
8
  import sys
9
  from ascii_colors import ASCIIColors
10
  import logging
 
11
  from lightrag.api import __api_version__
12
  from fastapi import HTTPException, Security, Request, status
13
  from dotenv import load_dotenv
 
16
  from .auth import auth_handler
17
  from ..prompt import PROMPTS
18
 
19
+
20
  def check_env_file():
21
  """
22
  Check if .env file exists and handle user confirmation if needed.
23
  Returns True if should continue, False if should exit.
24
  """
25
  if not os.path.exists(".env"):
26
+ warning_msg = (
27
+ "Warning: .env file not found. Some features may not work properly."
28
+ )
29
  ASCIIColors.yellow(warning_msg)
30
+
31
  # Check if running in interactive terminal
32
  if sys.stdin.isatty():
33
  response = input("Do you want to continue? (yes/no): ")
 
36
  return False
37
  return True
38
 
39
+
40
  # Load environment variables
41
  load_dotenv()
42
 
lightrag/utils.py CHANGED
@@ -75,7 +75,12 @@ class LightragPathFilter(logging.Filter):
75
  def __init__(self):
76
  super().__init__()
77
  # Define paths to be filtered
78
- self.filtered_paths = ["/documents", "/health", "/webui/", "/documents/pipeline_status"]
 
 
 
 
 
79
  # self.filtered_paths = ["/health", "/webui/"]
80
 
81
  def filter(self, record):
 
75
  def __init__(self):
76
  super().__init__()
77
  # Define paths to be filtered
78
+ self.filtered_paths = [
79
+ "/documents",
80
+ "/health",
81
+ "/webui/",
82
+ "/documents/pipeline_status",
83
+ ]
84
  # self.filtered_paths = ["/health", "/webui/"]
85
 
86
  def filter(self, record):