]> piware.de Git - bin.git/blobdiff - vcard2gnokii
vcard2gnokii: field type postal does not currently work, use note
[bin.git] / vcard2gnokii
index e585488f82b3aac9d65a36b163e23b228233a2d7..034f99d241e1e2e9a06940d5fddc2373c3293944 100755 (executable)
@@ -20,15 +20,16 @@ def output_info(info):
        kf = k.split(';')
        type = 0
        if len(kf) > 1:
-           if kf[1] == 'TYPE=HOME':
+           if kf[1].startswith('TYPE=HOME'):
                type = 2
-           elif kf[1] == 'TYPE=CELL':
+           elif kf[1].startswith('TYPE=CELL'):
                type = 3
-           elif kf[1] == 'TYPE=WORK':
+           elif kf[1].startswith('TYPE=WORK'):
                type = 6
 
        if kf[0] == 'ADR':
-           result += ';9;%i;%i;%s' % (type, id, '\\n'.join([f for f in v.split(';') if f]))
+            # current gnokii does not swallow type "9" (postal address)
+           result += ';10;0;%i;%s' % (id, '\\n'.join([f for f in v.split(';') if f]))
        elif kf[0] == 'EMAIL':
            result += ';8;%i;%i;%s' % (type, id, v)
        elif kf[0] == 'TEL':