def _get_search_url(txt):
 log.url.debug('Finding search engine for {!r}'.format(txt))
 (engine, term) = _parse_search_term(txt)
 assert term
 if (engine is None):
  template = config.get('searchengines', 'DEFAULT')
 else:
  template = config.get('searchengines', engine)
 url = qurl_from_user_input(template.format(urllib.parse.quote(term)))
 qtutils.ensure_valid(url)
 return url

def _get_search_url ( txt ) : log . url . debug ( 'Finding search engine for {!r}' . format ( txt ) ) ( engine , term ) = _parse_search_term ( txt ) assert term if ( engine is None ) : template = config . get ( 'searchengines' , 'DEFAULT' ) else : template = config . get ( 'searchengines' , engine ) url = qurl_from_user_input ( template . format ( urllib . parse . quote ( term ) ) ) qtutils . ensure_valid ( url ) return url
get a search engine url for a text .