formatting files
This commit is contained in:
parent
02cca793eb
commit
815892adf3
46 changed files with 232 additions and 230 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue