diff options
Diffstat (limited to 'bitbake/lib')
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 9 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/widgets.py | 6 |
2 files changed, 11 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 8e920f028a..05108975ae 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -200,16 +200,19 @@ def _verify_parameters(g, mandatory_parameters): | |||
200 | return None | 200 | return None |
201 | 201 | ||
202 | def _redirect_parameters(view, g, mandatory_parameters, *args, **kwargs): | 202 | def _redirect_parameters(view, g, mandatory_parameters, *args, **kwargs): |
203 | import urllib | 203 | try: |
204 | from urllib import unquote, urlencode | ||
205 | except ImportError: | ||
206 | from urllib.parse import unquote, urlencode | ||
204 | url = reverse(view, kwargs=kwargs) | 207 | url = reverse(view, kwargs=kwargs) |
205 | params = {} | 208 | params = {} |
206 | for i in g: | 209 | for i in g: |
207 | params[i] = g[i] | 210 | params[i] = g[i] |
208 | for i in mandatory_parameters: | 211 | for i in mandatory_parameters: |
209 | if not i in params: | 212 | if not i in params: |
210 | params[i] = urllib.unquote(str(mandatory_parameters[i])) | 213 | params[i] = unquote(str(mandatory_parameters[i])) |
211 | 214 | ||
212 | return redirect(url + "?%s" % urllib.urlencode(params), permanent = False, **kwargs) | 215 | return redirect(url + "?%s" % urlencode(params), permanent = False, **kwargs) |
213 | 216 | ||
214 | class RedirectException(Exception): | 217 | class RedirectException(Exception): |
215 | def __init__(self, view, g, mandatory_parameters, *args, **kwargs): | 218 | def __init__(self, view, g, mandatory_parameters, *args, **kwargs): |
diff --git a/bitbake/lib/toaster/toastergui/widgets.py b/bitbake/lib/toaster/toastergui/widgets.py index 19850fbcf4..551c33cff7 100644 --- a/bitbake/lib/toaster/toastergui/widgets.py +++ b/bitbake/lib/toaster/toastergui/widgets.py | |||
@@ -38,7 +38,11 @@ import json | |||
38 | import collections | 38 | import collections |
39 | import operator | 39 | import operator |
40 | import re | 40 | import re |
41 | import urllib | 41 | |
42 | try: | ||
43 | from urllib import unquote_plus | ||
44 | except ImportError: | ||
45 | from urllib.parse import unquote_plus | ||
42 | 46 | ||
43 | import logging | 47 | import logging |
44 | logger = logging.getLogger("toaster") | 48 | logger = logging.getLogger("toaster") |