From 5ad9b48f12e88a604592db9d293c1ba6311d0f84 Mon Sep 17 00:00:00 2001 From: "martin@piware.de" <> Date: Mon, 22 Dec 2008 13:13:45 +0100 Subject: [PATCH] vcard2gnokii: track memory position ourselves, for major speedup --- vcard2gnokii | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vcard2gnokii b/vcard2gnokii index 034f99d..4b7ef99 100755 --- a/vcard2gnokii +++ b/vcard2gnokii @@ -2,7 +2,7 @@ import sys -def output_info(info): +def output_info(info, pos): if info.has_key('X-EVOLUTION-FILE-AS'): result = info['X-EVOLUTION-FILE-AS'] elif info.has_key('N'): @@ -12,7 +12,7 @@ def output_info(info): print >> sys.stderr, 'No suitable name for', info return - result += ';;ME;;5' + result += ';;ME;%i;5' % pos id = 0 @@ -43,6 +43,7 @@ def output_info(info): print result +pos = 1 info = {} for line in open(sys.argv[1]): if not line or line[0] == ' ': @@ -60,6 +61,7 @@ for line in open(sys.argv[1]): if key == 'BEGIN': info = {} elif key == 'END': - output_info(info) + output_info(info, pos) + pos += 1 if value: info[key] = value.strip() -- 2.39.2