From 1356d71839f8dfab10dcf37cd44c481581b3e444 Mon Sep 17 00:00:00 2001 From: ManishMadan2882 Date: Tue, 5 Aug 2025 15:37:39 +0530 Subject: [PATCH] (lint) ruff fix --- application/api/answer/routes/stream.py | 2 +- application/api/internal/routes.py | 2 +- application/api/user/routes.py | 3 +-- application/parser/file/bulk.py | 2 +- application/storage/local.py | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/application/api/answer/routes/stream.py b/application/api/answer/routes/stream.py index ad74dfd6..3fee3f5b 100644 --- a/application/api/answer/routes/stream.py +++ b/application/api/answer/routes/stream.py @@ -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 diff --git a/application/api/internal/routes.py b/application/api/internal/routes.py index 89531703..f0c2950e 100755 --- a/application/api/internal/routes.py +++ b/application/api/internal/routes.py @@ -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: diff --git a/application/api/user/routes.py b/application/api/user/routes.py index 90857043..1566a98b 100644 --- a/application/api/user/routes.py +++ b/application/api/user/routes.py @@ -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 ) diff --git a/application/parser/file/bulk.py b/application/parser/file/bulk.py index 978ec87c..c8f2234a 100644 --- a/application/parser/file/bulk.py +++ b/application/parser/file/bulk.py @@ -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 = {} diff --git a/application/storage/local.py b/application/storage/local.py index 89b49bee..cf0ebcb8 100644 --- a/application/storage/local.py +++ b/application/storage/local.py @@ -136,5 +136,5 @@ class LocalStorage(BaseStorage): try: shutil.rmtree(full_path) return True - except (OSError, PermissionError) as e: + except (OSError, PermissionError): return False