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

@@ -6,7 +6,7 @@ from datetime import datetime
from mimetypes import MimeTypes
from tqdm import tqdm
from Whatsapp_Chat_Exporter.data_model import ChatStore, Message
from Whatsapp_Chat_Exporter.utility import CLEAR_LINE, Device, convert_time_unit
from Whatsapp_Chat_Exporter.utility import Device, convert_time_unit
logger = logging.getLogger(__name__)
@@ -43,7 +43,7 @@ def messages(path, data, assume_first_as_me=False):
)
pbar.update(1)
total_time = pbar.format_dict['elapsed']
logger.info(f"Processed {total_row_number} messages & media in {convert_time_unit(total_time)}{CLEAR_LINE}")
logger.info(f"Processed {total_row_number} messages & media in {convert_time_unit(total_time)}")
return data