mirror of
https://github.com/KnugiHK/WhatsApp-Chat-Exporter.git
synced 2026-01-29 05:40:42 +00:00
The check happened in __main__ already
This commit is contained in:
@@ -546,8 +546,8 @@ def main():
|
||||
if (args.filter_empty):
|
||||
data = {k: v for k, v in data.items() if not is_chat_empty(v)}
|
||||
|
||||
if contacts_names_from_vcards_enricher.should_enrich_names_from_vCards():
|
||||
contacts_names_from_vcards_enricher.enrich_names_from_vCards(data)
|
||||
if contact_store.should_enrich_from_vcards():
|
||||
|
||||
if isinstance(data[next(iter(data))], ChatStore):
|
||||
data = {jik: chat.to_json() for jik, chat in data.items()}
|
||||
|
||||
@@ -1,23 +1,15 @@
|
||||
import itertools
|
||||
from typing import List, TypedDict
|
||||
|
||||
try:
|
||||
import vobject
|
||||
except ModuleNotFoundError:
|
||||
vcards_deps_installed = False
|
||||
else:
|
||||
vcards_deps_installed = True
|
||||
import vobject
|
||||
|
||||
class ContactsNamesFromVCards:
|
||||
def __init__(self) -> None:
|
||||
self.l = []
|
||||
|
||||
def should_enrich_names_from_vCards(self):
|
||||
def should_enrich_from_vcards(self):
|
||||
return len(self.l) > 0
|
||||
|
||||
def load_vcf_file(self, vcfFilePath: str, default_country_calling_code: str):
|
||||
if not vcards_deps_installed:
|
||||
raise Exception('Invariant: vobject is missing')
|
||||
self.l = readVCardsFile(vcfFilePath, default_country_calling_code)
|
||||
|
||||
def enrich_names_from_vCards(self, chats):
|
||||
|
||||
Reference in New Issue
Block a user