mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
(lint) ruff fix
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import logging
|
||||
import traceback
|
||||
|
||||
from flask import make_response, request, Response
|
||||
from flask import request, Response
|
||||
from flask_restx import fields, Resource
|
||||
|
||||
from application.api import api
|
||||
|
||||
@@ -55,7 +55,7 @@ def upload_index_files():
|
||||
if directory_structure:
|
||||
try:
|
||||
directory_structure = json.loads(directory_structure)
|
||||
except:
|
||||
except Exception:
|
||||
logger.error("Error parsing directory_structure")
|
||||
directory_structure = {}
|
||||
else:
|
||||
|
||||
@@ -3,7 +3,6 @@ import json
|
||||
import math
|
||||
import os
|
||||
import secrets
|
||||
import shutil
|
||||
import uuid
|
||||
from functools import wraps
|
||||
from typing import Optional, Tuple
|
||||
@@ -735,7 +734,7 @@ class ManageSourceFiles(Resource):
|
||||
|
||||
try:
|
||||
file_paths = json.loads(file_paths_str) if isinstance(file_paths_str, str) else file_paths_str
|
||||
except:
|
||||
except Exception:
|
||||
return make_response(
|
||||
jsonify({"success": False, "message": "Invalid file_paths format"}), 400
|
||||
)
|
||||
|
||||
@@ -197,7 +197,7 @@ class SimpleDirectoryReader(BaseReader):
|
||||
# Build directory structure if input_dir is provided
|
||||
if hasattr(self, 'input_dir'):
|
||||
self.directory_structure = self.build_directory_structure(self.input_dir)
|
||||
logging.info(f"Directory structure built successfully")
|
||||
logging.info("Directory structure built successfully")
|
||||
else:
|
||||
self.directory_structure = {}
|
||||
|
||||
|
||||
@@ -136,5 +136,5 @@ class LocalStorage(BaseStorage):
|
||||
try:
|
||||
shutil.rmtree(full_path)
|
||||
return True
|
||||
except (OSError, PermissionError) as e:
|
||||
except (OSError, PermissionError):
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user