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'):
print >> sys.stderr, 'No suitable name for', info
return
- result += ';;ME;;5'
+ result += ';;ME;%i;5' % pos
id = 0
print result
+pos = 1
info = {}
for line in open(sys.argv[1]):
if not line or line[0] == ' ':
if key == 'BEGIN':
info = {}
elif key == 'END':
- output_info(info)
+ output_info(info, pos)
+ pos += 1
if value:
info[key] = value.strip()