myPIM

Check-in [473c444d02]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Quick-n-dirty VCF exporter so my DB is on my phone. Huh, worked the first time, so far as I can tell....
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:473c444d0262dfa083b048f5aa009a24f9ff7d89bb48b6339d3f85fe606a15ef
User & Date: vandys 2018-07-06 00:33:22
Context
2018-07-07
15:26
Add some notes on the DB format check-in: d776dfe659 user: vandys tags: master, trunk
2018-07-06
00:33
Quick-n-dirty VCF exporter so my DB is on my phone. Huh, worked the first time, so far as I can tell.... check-in: 473c444d02 user: vandys tags: master, trunk
2018-06-25
03:11
cleanup check-in: 5abffced93 user: vandys tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added db2vcf.py.























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/local/bin/tauthon
#
# db2vcf.py
#	Read our internal DB, generate VCF for import to a phone
#
import sys
import mm
import pdb

def w(s):
    sys.stdout.write("%s\n" % (s,))

# Generate VCARD for one person
def dump_peep(p):
    w("BEGIN:VCARD")
    w("FN:%s" % (p.name,))
    for k,v in p.phones.iteritems():
	w("TEL;TYPE=%s:%s" % (k, v))
    for k,v in p.email.iteritems():
	w("EMAIL;TYPE=INTERNET;TYPE=%s:%s" % (k, v))
    w("END:VCARD")

if __name__ == "__main__":
    mm.read_cfg()
    mm.load_dbs()
    for p in mm.db.persons:
	dump_peep(p)