|
|
@@ -1,9 +1,15 @@
|
|
|
# Doc
|
|
|
# Script to extract Contacts from Sailfish Contact SQLite DB located at
|
|
|
+#
|
|
|
+#
|
|
|
+# Links
|
|
|
+# FileFormatdescription: https://docs.fileformat.com/email/vcf/#vcf-30-example
|
|
|
+# Pytho vobject: http://eventable.github.io/vobject/
|
|
|
# ChangeLog
|
|
|
|
|
|
import sqlite3
|
|
|
import vobject
|
|
|
+import uuid
|
|
|
|
|
|
SQLconn = sqlite3.connect('../Testdata/system/Contacts/qtcontacts-sqlite/contacts.db')
|
|
|
|
|
|
@@ -17,6 +23,8 @@ try:
|
|
|
contactID=row[0]
|
|
|
|
|
|
vcf = vobject.vCard()
|
|
|
+ vcf.add('uid').value = str(uuid.uuid4())
|
|
|
+ #vcf.add('uid').value = "Testdaten"
|
|
|
vcf.add('n')
|
|
|
vcf.n.value = vobject.vcard.Name( family=row[6], given=row[4] )
|
|
|
vcf.add('fn')
|
|
|
@@ -25,14 +33,18 @@ try:
|
|
|
SQLEmailCur = SQLconn.cursor()
|
|
|
## Abfragen E-Mail-Adressen
|
|
|
for Emailrow in SQLEmailCur.execute('SELECT * from EmailAddresses JOIN Details on Details.detailId= EmailAddresses.detailId where EmailAddresses.contactId = ' + str(contactID)):
|
|
|
+
|
|
|
+ # debug ausgabe
|
|
|
+ print("debug: " + Emailrow[2])
|
|
|
+
|
|
|
vcf.add('email')
|
|
|
vcf.email.value = Emailrow[2]
|
|
|
vcf.email.type_param = Emailrow[9]
|
|
|
|
|
|
|
|
|
- vcf.prettyPrint()
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
except:
|
|
|
print("Error in executing SQL")
|
|
|
+
|
|
|
+
|
|
|
+print(vcf.serialize())
|
|
|
+
|