fix: Fix flake8 linting errors

This commit is contained in:
Drikus Roor
2023-04-13 11:05:36 +02:00
parent 62edc148a8
commit abe01ab81e
3 changed files with 5 additions and 5 deletions

View File

@@ -67,6 +67,7 @@ def execute_python_file(file):
except Exception as e: except Exception as e:
return f"Error: {str(e)}" return f"Error: {str(e)}"
def execute_shell(command_line): def execute_shell(command_line):
current_dir = os.getcwd() current_dir = os.getcwd()

View File

@@ -161,11 +161,11 @@ class ConsoleHandler(logging.StreamHandler):
self.handleError(record) 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): 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: def format(self, record: LogRecord) -> str:
if (hasattr(record, 'color')): if (hasattr(record, 'color')):
record.title_color = getattr(record, 'color') + getattr(record, 'title') + " " + Style.RESET_ALL record.title_color = getattr(record, 'color') + getattr(record, 'title') + " " + Style.RESET_ALL

View File

@@ -4,7 +4,6 @@ from config import AbstractSingleton, Config
import openai import openai
cfg = Config() cfg = Config()
cfg = Config()
def get_ada_embedding(text): def get_ada_embedding(text):
text = text.replace("\n", " ") text = text.replace("\n", " ")