optimization
This commit is contained in:
parent
01ebe8b545
commit
0aa8b0a234
1 changed files with 6 additions and 10 deletions
|
|
@ -1,18 +1,18 @@
|
|||
import os
|
||||
import sys
|
||||
import quopri
|
||||
import base64
|
||||
import pickle
|
||||
import phonenumbers
|
||||
from pythonvCard4.vcard import Contact
|
||||
|
||||
input_file = open(sys.argv[1], 'r').readlines()
|
||||
input_file = open(sys.argv[1], 'r', encoding="latin-1").readlines()
|
||||
output = open('output.vcf', 'w')
|
||||
|
||||
check_for_multiple_pictures = False
|
||||
|
||||
cards = []
|
||||
current_card = ""
|
||||
|
||||
for line in input_file:
|
||||
|
||||
current_card += line
|
||||
|
||||
if "END:VCARD" in line:
|
||||
|
|
@ -45,11 +45,7 @@ for line in input_file:
|
|||
continue
|
||||
contact.tel = clean_tel
|
||||
|
||||
cards.append(contact)
|
||||
vcf_text = contact.to_vcard()
|
||||
output.write(vcf_text)
|
||||
current_card = ""
|
||||
continue
|
||||
|
||||
output = open('output.vcf', 'w')
|
||||
for card in cards:
|
||||
vcf_text = card.to_vcard()
|
||||
output.write(vcf_text)
|
||||
|
|
|
|||
Loading…
Reference in a new issue