[750g] strip accents in search URL
This commit is contained in:
parent
76c3454617
commit
ff0f7c12d0
1 changed files with 6 additions and 1 deletions
|
|
@ -22,6 +22,11 @@ from weboob.tools.backend import BaseBackend
|
||||||
|
|
||||||
from .browser import SevenFiftyGramsBrowser
|
from .browser import SevenFiftyGramsBrowser
|
||||||
|
|
||||||
|
import unicodedata
|
||||||
|
|
||||||
|
def strip_accents(s):
|
||||||
|
return ''.join(c for c in unicodedata.normalize('NFD', s) if unicodedata.category(c) != 'Mn')
|
||||||
|
|
||||||
__all__ = ['SevenFiftyGramsBackend']
|
__all__ = ['SevenFiftyGramsBackend']
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -41,7 +46,7 @@ class SevenFiftyGramsBackend(BaseBackend, ICapRecipe):
|
||||||
return self.browser.get_recipe(id)
|
return self.browser.get_recipe(id)
|
||||||
|
|
||||||
def iter_recipes(self, pattern):
|
def iter_recipes(self, pattern):
|
||||||
return self.browser.iter_recipes(pattern.encode('utf-8'))
|
return self.browser.iter_recipes(strip_accents(pattern).encode('utf-8'))
|
||||||
|
|
||||||
def fill_recipe(self, recipe, fields):
|
def fill_recipe(self, recipe, fields):
|
||||||
if 'nb_person' in fields or 'instructions' in fields:
|
if 'nb_person' in fields or 'instructions' in fields:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue