def _parse_author(elm_author, ctx):
 xp_templ = 'normalize-space(fb:%s/text())'
 author = ctx.XPath((xp_templ % 'first-name'))(elm_author)
 lname = ctx.XPath((xp_templ % 'last-name'))(elm_author)
 mname = ctx.XPath((xp_templ % 'middle-name'))(elm_author)
 if mname:
  author = ((author + ' ') + mname).strip()
 if lname:
  author = ((author + ' ') + lname).strip()
 if (not author):
  nname = ctx.XPath((xp_templ % 'nickname'))(elm_author)
  if nname:
   author = nname
 return author

def _parse_author ( elm_author , ctx ) : xp_templ = 'normalize-space(fb:%s/text())' author = ctx . XPath ( ( xp_templ % 'first-name' ) ) ( elm_author ) lname = ctx . XPath ( ( xp_templ % 'last-name' ) ) ( elm_author ) mname = ctx . XPath ( ( xp_templ % 'middle-name' ) ) ( elm_author ) if mname : author = ( ( author + ' ' ) + mname ) . strip ( ) if lname : author = ( ( author + ' ' ) + lname ) . strip ( ) if ( not author ) : nname = ctx . XPath ( ( xp_templ % 'nickname' ) ) ( elm_author ) if nname : author = nname return author
returns a list of display author and sortable author .