def protolinks_simple(proto, url):
 if (proto in ('iframe', 'embed')):
  return ('<iframe src="%s" frameborder="0" allowfullscreen></iframe>' % url)
 elif (proto == 'qr'):
  return ('<img style="width:100px" src="http://chart.apis.google.com/chart?cht=qr&chs=100x100&chl=%s&choe=UTF-8&chld=H" alt="QR Code" title="QR Code" />' % url)
 return ((proto + ':') + url)

def protolinks_simple ( proto , url ) : if ( proto in ( 'iframe' , 'embed' ) ) : return ( '<iframe src="%s" frameborder="0" allowfullscreen></iframe>' % url ) elif ( proto == 'qr' ) : return ( '<img style="width:100px" src="http://chart.apis.google.com/chart?cht=qr&chs=100x100&chl=%s&choe=UTF-8&chld=H" alt="QR Code" title="QR Code" />' % url ) return ( ( proto + ':' ) + url )
it converts url to html-string using appropriate proto-prefix: uses for construction "proto:url" .