diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-05-10 17:06:54 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-16 23:32:42 +0100 |
commit | 5582444b10418bef14ff274a2470a9050d7a7e17 (patch) | |
tree | 8d248999bd347aab0ac7494eafecd68205bc20c4 /bitbake/lib/toaster/toastergui/api.py | |
parent | 473daf72545421ee2df40278efda7d3999a5d356 (diff) | |
download | poky-5582444b10418bef14ff274a2470a9050d7a7e17.tar.gz |
bitbake: toaster: use re.sub() instead of translate()
translate has different set of parameters in python 3 and
can't be used the way it's used in toaster api module.
Replacing it with re.sub() should make the code work in
both python 2 and python 3.
[YOCTO #9584]
(Bitbake rev: 019ac4792f388f3313812c1998492888be8b97cd)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/api.py')
-rw-r--r-- | bitbake/lib/toaster/toastergui/api.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/api.py b/bitbake/lib/toaster/toastergui/api.py index 42901f750a..961b594ef4 100644 --- a/bitbake/lib/toaster/toastergui/api.py +++ b/bitbake/lib/toaster/toastergui/api.py | |||
@@ -18,6 +18,7 @@ | |||
18 | 18 | ||
19 | 19 | ||
20 | # Temporary home for the UI's misc API | 20 | # Temporary home for the UI's misc API |
21 | import re | ||
21 | 22 | ||
22 | from orm.models import Project, ProjectTarget, Build | 23 | from orm.models import Project, ProjectTarget, Build |
23 | from bldcontrol.models import BuildRequest | 24 | from bldcontrol.models import BuildRequest |
@@ -92,7 +93,7 @@ class XhrBuildRequest(View): | |||
92 | if 'targets' in request.POST: | 93 | if 'targets' in request.POST: |
93 | ProjectTarget.objects.filter(project = project).delete() | 94 | ProjectTarget.objects.filter(project = project).delete() |
94 | s = str(request.POST['targets']) | 95 | s = str(request.POST['targets']) |
95 | for t in s.translate(None, ";%|\"").split(" "): | 96 | for t in re.sub(r'[;%|"]', '', s).split(" "): |
96 | if ":" in t: | 97 | if ":" in t: |
97 | target, task = t.split(":") | 98 | target, task = t.split(":") |
98 | else: | 99 | else: |