From c6d59c5e4ea9ae44664ace79ecdb5ab8873baf30 Mon Sep 17 00:00:00 2001 From: "martin@piware.de" <> Date: Mon, 22 Dec 2008 12:53:15 +0100 Subject: [PATCH] vcard2gnokii: use proper IDs --- vcard2gnokii | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) 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 -- 2.39.2