def fix_vobject(vcard):
 if ('fn' not in vcard.contents):
  logging.debug('vcard has no formatted name, reconstructing...')
  fname = vcard.contents['n'][0].valueRepr()
  fname = fname.strip()
  vcard.add('fn')
  vcard.fn.value = fname
 return vcard

def fix_vobject ( vcard ) : if ( 'fn' not in vcard . contents ) : logging . debug ( 'vcard has no formatted name, reconstructing...' ) fname = vcard . contents [ 'n' ] [ 0 ] . valueRepr ( ) fname = fname . strip ( ) vcard . add ( 'fn' ) vcard . fn . value = fname return vcard
trying to fix some more or less common errors in vcards for now only missing fn properties are handled :type vcard: vobject .