diff --git a/Whatsapp_Chat_Exporter/__main__.py b/Whatsapp_Chat_Exporter/__main__.py index 37f9b54..93a578c 100644 --- a/Whatsapp_Chat_Exporter/__main__.py +++ b/Whatsapp_Chat_Exporter/__main__.py @@ -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): diff --git a/Whatsapp_Chat_Exporter/contacts_from_vcards.py b/Whatsapp_Chat_Exporter/vcards_contacts.py similarity index 98% rename from Whatsapp_Chat_Exporter/contacts_from_vcards.py rename to Whatsapp_Chat_Exporter/vcards_contacts.py index 58d5eaa..95fc155 100644 --- a/Whatsapp_Chat_Exporter/contacts_from_vcards.py +++ b/Whatsapp_Chat_Exporter/vcards_contacts.py @@ -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): diff --git a/Whatsapp_Chat_Exporter/contacts_from_vcards_test.py b/Whatsapp_Chat_Exporter/vcards_contacts_test.py similarity index 86% rename from Whatsapp_Chat_Exporter/contacts_from_vcards_test.py rename to Whatsapp_Chat_Exporter/vcards_contacts_test.py index bd4929b..194b637 100644 --- a/Whatsapp_Chat_Exporter/contacts_from_vcards_test.py +++ b/Whatsapp_Chat_Exporter/vcards_contacts_test.py @@ -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():