Rename variable and files

This commit is contained in:
KnugiHK
2024-07-13 14:16:57 +08:00
parent 80bdc4414a
commit 0cf113561a
3 changed files with 5 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ else:
vcards_deps_installed = True
from Whatsapp_Chat_Exporter import exported_handler, android_handler
from Whatsapp_Chat_Exporter import ios_handler, ios_media_handler
from Whatsapp_Chat_Exporter.contacts_from_vcards import ContactsFromVCards
from Whatsapp_Chat_Exporter.vcards_contacts import ContactsFromVCards
from Whatsapp_Chat_Exporter.data_model import ChatStore
from Whatsapp_Chat_Exporter.utility import APPLE_TIME, Crypt, DbType, chat_is_empty
from Whatsapp_Chat_Exporter.utility import check_update, import_from_json
@@ -483,7 +483,7 @@ def main():
if args.android:
android_handler.calls(db, data, args.timezone_offset, filter_chat)
if not args.no_html:
if contact_store.should_enrich_from_vcards():
if contact_store.is_empty():
contact_store.enrich_from_vcards(data)
create_html(
@@ -552,7 +552,7 @@ def main():
if not args.filter_empty:
data = {k: v for k, v in data.items() if not chat_is_empty(v)}
if contact_store.should_enrich_from_vcards():
if contact_store.is_empty():
contact_store.enrich_from_vcards(data)
if isinstance(data[next(iter(data))], ChatStore):

View File

@@ -12,7 +12,7 @@ class ContactsFromVCards:
def __init__(self) -> None:
self.contact_mapping = []
def should_enrich_from_vcards(self):
def is_empty(self):
return len(self.contact_mapping) > 0
def load_vcf_file(self, vcf_file_path: str, default_country_code: str):

View File

@@ -1,6 +1,6 @@
# from contacts_names_from_vcards import readVCardsFile
from Whatsapp_Chat_Exporter.contacts_from_vcards import normalize_number, read_vcards_file
from Whatsapp_Chat_Exporter.vcards_contacts import normalize_number, read_vcards_file
def test_readVCardsFile():