From 5c8008d162a67c77665c1fb50bd9501c72149b7d Mon Sep 17 00:00:00 2001 From: Caleb Powell Date: Tue, 24 Jul 2018 13:52:43 -0400 Subject: [PATCH] accept spaces in Search class Adjusts the Search class to accept spaces in query strings. ie: 'Saiga tatarica' will be changed to the URL appropriate syntax 'Saiga+tatarica' behind the scenes. --- eol_api_wrapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eol_api_wrapper.py b/eol_api_wrapper.py index d4a6670..eebaac5 100644 --- a/eol_api_wrapper.py +++ b/eol_api_wrapper.py @@ -199,7 +199,7 @@ def __init__(self, q, page = 1, exact = False, filter_by_taxon_concept_id = '', if not isinstance(page, int) and page!='all': raise ValueError('Not a valid page number') - + q = q.replace(' ', '+') # prep search strings for the url syntax. attributes = [q,page,API._bool_converter(exact),filter_by_taxon_concept_id, filter_by_hierarchy_entry_id, filter_by_string, cache_ttl, key] url = (