Skip to content

Commit

Permalink
Tested
Browse files Browse the repository at this point in the history
  • Loading branch information
shivamgutgutia committed Nov 18, 2023
1 parent ff5a3f2 commit 78b0853
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions utils/vcfGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,19 @@ def generateVcard(row, headers, vCards):
fields = fields.split(",") if fields else []
for field in fields:
phone = row.get(field,"")
telephone = vcard.add("tel")
telephone.type_param = ["HOME"]
telephone.value = phone
if phone:
telephone = vcard.add("tel")
telephone.type_param = ["HOME"]
telephone.value = phone

fields=headers.get("E-Mail","")
fields = fields.split(",") if fields else []
for field in fields.split(","):
for field in fields:
email = row.get(field,"")
mail = vcard.add("email")
mail.type_param = ["HOME"]
mail.value = email
if email:
mail = vcard.add("email")
mail.type_param = ["HOME"]
mail.value = email

vcard.add('version').value = '4.0'
vCards.append(vcard)
Expand Down

0 comments on commit 78b0853

Please sign in to comment.