From abe01ab81e0428b6b9cc1844df8e2130c9ffe3f6 Mon Sep 17 00:00:00 2001 From: Drikus Roor Date: Thu, 13 Apr 2023 11:05:36 +0200 Subject: [PATCH] fix: Fix flake8 linting errors --- scripts/execute_code.py | 1 + scripts/logger.py | 8 ++++---- scripts/memory/base.py | 1 - 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/execute_code.py b/scripts/execute_code.py index 2c92903c..dbd62c22 100644 --- a/scripts/execute_code.py +++ b/scripts/execute_code.py @@ -67,6 +67,7 @@ def execute_python_file(file): except Exception as e: return f"Error: {str(e)}" + def execute_shell(command_line): current_dir = os.getcwd() diff --git a/scripts/logger.py b/scripts/logger.py index 42a43878..f5e94687 100644 --- a/scripts/logger.py +++ b/scripts/logger.py @@ -161,11 +161,11 @@ class ConsoleHandler(logging.StreamHandler): self.handleError(record) -''' -Allows to handle custom placeholders 'title_color' and 'message_no_color'. -To use this formatter, make sure to pass 'color', 'title' as log extras. -''' class AutoGptFormatter(logging.Formatter): + """ + Allows to handle custom placeholders 'title_color' and 'message_no_color'. + To use this formatter, make sure to pass 'color', 'title' as log extras. + """ def format(self, record: LogRecord) -> str: if (hasattr(record, 'color')): record.title_color = getattr(record, 'color') + getattr(record, 'title') + " " + Style.RESET_ALL diff --git a/scripts/memory/base.py b/scripts/memory/base.py index 1be7b3dd..96cf3df1 100644 --- a/scripts/memory/base.py +++ b/scripts/memory/base.py @@ -4,7 +4,6 @@ from config import AbstractSingleton, Config import openai cfg = Config() -cfg = Config() def get_ada_embedding(text): text = text.replace("\n", " ")