def search_count(db, query):
 global _search_db_names
 if (_search_db_names is None):
  _search_db_names = _get_fields((_BASE_URL + '/search'))
 if (db not in _search_db_names):
  import warnings
  warnings.warn(("TogoWS search does not officially support database '%s'. See %s/search/ for options." % (db, _BASE_URL)))
 url = (_BASE_URL + ('/search/%s/%s/count' % (db, _quote(query))))
 handle = _open(url)
 data = handle.read()
 handle.close()
 try:
  count = int(data.strip())
 except ValueError:
  raise ValueError(('Expected an integer from URL %s, got: %r' % (url, data)))
 return count

def search_count ( db , query ) : global _search_db_names if ( _search_db_names is None ) : _search_db_names = _get_fields ( ( _BASE_URL + '/search' ) ) if ( db not in _search_db_names ) : import warnings warnings . warn ( ( "TogoWS search does not officially support database '%s'. See %s/search/ for options." % ( db , _BASE_URL ) ) ) url = ( _BASE_URL + ( '/search/%s/%s/count' % ( db , _quote ( query ) ) ) ) handle = _open ( url ) data = handle . read ( ) handle . close ( ) try : count = int ( data . strip ( ) ) except ValueError : raise ValueError ( ( 'Expected an integer from URL %s, got: %r' % ( url , data ) ) ) return count
togows search count .