formatting files

This commit is contained in:
cristhianzl 2024-06-06 21:44:40 -03:00
commit 815892adf3
46 changed files with 232 additions and 230 deletions

View file

@ -41,7 +41,7 @@ IMG_FILE_TYPES = [
def normalize_text(text):
return unicodedata.normalize('NFKD', text)
return unicodedata.normalize("NFKD", text)
def is_hidden(path: Path) -> bool:
@ -106,7 +106,7 @@ def read_text_file(file_path: str) -> str:
result = chardet.detect(raw_data)
encoding = result["encoding"]
if encoding in ['Windows-1254', 'MacRoman']:
if encoding in ["Windows-1254", "MacRoman"]:
encoding = "utf-8"
with open(file_path, "r", encoding=encoding) as f:

View file

@ -115,7 +115,9 @@ class MonitorService(Service):
return self.exec_query(query)
def update_message(self, message_id: int, **kwargs):
query = f"""UPDATE messages SET {', '.join(f"{k} = '{v}'" for k, v in kwargs.items())} WHERE index = {message_id}"""
query = (
f"""UPDATE messages SET {', '.join(f"{k} = '{v}'" for k, v in kwargs.items())} WHERE index = {message_id}"""
)
return self.exec_query(query)