Refactor CLEAR_LINE in a more pythonic way

So it is easier for contributor to write a logging line for this project.
This commit is contained in:
KnugiHK
2026-01-24 16:48:07 +08:00
parent 746e4e1ac5
commit 4eed3ca321
8 changed files with 81 additions and 69 deletions

View File

@@ -3,7 +3,7 @@ import re
import quopri
from typing import List, TypedDict
from Whatsapp_Chat_Exporter.data_model import ChatStore
from Whatsapp_Chat_Exporter.utility import CLEAR_LINE, Device
from Whatsapp_Chat_Exporter.utility import Device
logger = logging.getLogger(__name__)
@@ -47,7 +47,7 @@ def decode_quoted_printable(value: str, charset: str) -> str:
# Fallback: return the original value if decoding fails
logger.warning(
f"Failed to decode quoted-printable value: {value}, "
f"charset: {charset}. Please report this issue.{CLEAR_LINE}"
f"charset: {charset}. Please report this issue."
)
return value
@@ -176,7 +176,7 @@ def read_vcards_file(vcf_file_path, default_country_code: str):
if contact := process_vcard_entry(vcard):
contacts.append(contact)
logger.info(f"Imported {len(contacts)} contacts/vcards{CLEAR_LINE}")
logger.info(f"Imported {len(contacts)} contacts/vcards")
return map_number_to_name(contacts, default_country_code)