profile is now a dict, not a list

This commit is contained in:
Romain Bignon 2011-10-05 15:36:50 +02:00
commit 97fe89ab66
4 changed files with 14 additions and 11 deletions

View file

@ -38,7 +38,7 @@ class ProfileFormatter(IFormatter):
result = u''
if node.flags & node.SECTION:
result += u'\t' * level + node.label + '\n'
for sub in node.value:
for sub in node.value.itervalues():
result += self.print_node(sub, level+1)
else:
if isinstance(node.value, (tuple,list)):
@ -63,7 +63,7 @@ class ProfileFormatter(IFormatter):
for name, photo in item['photos'].iteritems():
result += u'\t%s%s\n' % (photo, ' (hidden)' if photo.hidden else '')
result += u'Profile:\n'
for head in item['profile']:
for head in item['profile'].itervalues():
result += self.print_node(head)
result += u'Description:\n'
for s in item['summary'].split('\n'):

View file

@ -250,7 +250,7 @@ class ContactProfile(QWidget):
missing_fields.add('profile')
elif not self.loaded_profile:
self.loaded_profile = True
for head in contact.profile:
for head in contact.profile.itervalues():
if head.flags & head.HEAD:
widget = self.ui.headWidget
else:
@ -265,7 +265,7 @@ class ContactProfile(QWidget):
if node.flags & node.SECTION:
value = QWidget()
value.setLayout(QFormLayout())
for sub in node.value:
for sub in node.value.itervalues():
self.process_node(sub, value)
elif isinstance(node.value, list):
value = QLabel('<br />'.join(unicode(s) for s in node.value))