From: martin@piware.de <> Date: Mon, 22 Dec 2008 11:53:15 +0000 (+0100) Subject: vcard2gnokii: use proper IDs X-Git-Url: https://piware.de/gitweb/?a=commitdiff_plain;h=c6d59c5e4ea9ae44664ace79ecdb5ab8873baf30;p=bin.git vcard2gnokii: use proper IDs --- diff --git a/vcard2gnokii b/vcard2gnokii index 9b40a87..e585488 100755 --- a/vcard2gnokii +++ b/vcard2gnokii @@ -14,6 +14,8 @@ def output_info(info): result += ';;ME;;5' + id = 0 + for k, v in info.iteritems(): kf = k.split(';') type = 0 @@ -26,13 +28,17 @@ def output_info(info): type = 6 if kf[0] == 'ADR': - result += ';9;%i;9;%s' % (type, '\\n'.join([f for f in v.split(';') if f])) - if kf[0] == 'EMAIL': - result += ';8;%i;8;%s' % (type, v) - if kf[0] == 'TEL': - result += ';11;%i;11;%s' % (type, v) - if kf[0] == 'BDAY': - result += ';10;0;10;BDAY: ' + v + result += ';9;%i;%i;%s' % (type, 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': + result += ';11;%i;%i;%s' % (type, id, v) + elif kf[0] == 'BDAY': + result += (';10;0;%i;BDAY: ' %id) + v + else: + continue + + id += 1 print result