mirror of
https://git.yoctoproject.org/poky
synced 2026-09-14 21:49:33 +02:00
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: 7cc3a41139abc5b8d1eef4376fb19aba3910ce0d) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
d393fe6cff
commit
cf454d74a8
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
|
|
||||||
# Temporary home for the UI's misc API
|
# Temporary home for the UI's misc API
|
||||||
|
import re
|
||||||
|
|
||||||
from orm.models import Project, ProjectTarget, Build
|
from orm.models import Project, ProjectTarget, Build
|
||||||
from bldcontrol.models import BuildRequest
|
from bldcontrol.models import BuildRequest
|
||||||
@@ -92,7 +93,7 @@ class XhrBuildRequest(View):
|
|||||||
if 'targets' in request.POST:
|
if 'targets' in request.POST:
|
||||||
ProjectTarget.objects.filter(project = project).delete()
|
ProjectTarget.objects.filter(project = project).delete()
|
||||||
s = str(request.POST['targets'])
|
s = str(request.POST['targets'])
|
||||||
for t in s.translate(None, ";%|\"").split(" "):
|
for t in re.sub(r'[;%|"]', '', s).split(" "):
|
||||||
if ":" in t:
|
if ":" in t:
|
||||||
target, task = t.split(":")
|
target, task = t.split(":")
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user