def expand_line(line, sites):
 try:
  l = line.strip()
  (msg_format, links) = find_links(l)
  args = tuple((follow_redirects(l, sites) for l in links))
  line = (msg_format % args)
 except Exception as e:
  try:
   err(('expanding line %s failed due to %s' % (line, unicode(e))))
  except:
   pass
 return line

def expand_line ( line , sites ) : try : l = line . strip ( ) ( msg_format , links ) = find_links ( l ) args = tuple ( ( follow_redirects ( l , sites ) for l in links ) ) line = ( msg_format % args ) except Exception as e : try : err ( ( 'expanding line %s failed due to %s' % ( line , unicode ( e ) ) ) ) except : pass return line
expand the links in the line for the given sites .