result += ';;ME;;5'
+ id = 0
+
for k, v in info.iteritems():
kf = k.split(';')
type = 0
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