Browse Source

[fix] engine selection from url

Adam Tauber 9 years ago
parent
commit
8c4d9b79d5
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      searx/search.py

+ 2
- 2
searx/search.py View File

391
             load_default_categories = True
391
             load_default_categories = True
392
             for pd_name, pd in self.request_data.items():
392
             for pd_name, pd in self.request_data.items():
393
                 if pd_name == 'categories':
393
                 if pd_name == 'categories':
394
-                    self.categories.extend(categ.strip() for categ in pd.split(',') if categ in categories)
394
+                    self.categories.extend(categ for categ in map(unicode.strip, pd.split(',')) if categ in categories)
395
                 elif pd_name == 'engines':
395
                 elif pd_name == 'engines':
396
                     pd_engines = [{'category': engines[engine].categories[0],
396
                     pd_engines = [{'category': engines[engine].categories[0],
397
                                    'name': engine}
397
                                    'name': engine}
398
-                                  for engine in map(str.strip, pd.split(',')) if engine in engines]
398
+                                  for engine in map(unicode.strip, pd.split(',')) if engine in engines]
399
                     if pd_engines:
399
                     if pd_engines:
400
                         self.engines.extend(pd_engines)
400
                         self.engines.extend(pd_engines)
401
                         load_default_categories = False
401
                         load_default_categories = False