diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index a7f58ad5e1..4a1cdec5a8 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -2325,12 +2325,9 @@ if toastermain.settings.MANAGED: | |||
2325 | variable = t | 2325 | variable = t |
2326 | value = "" | 2326 | value = "" |
2327 | 2327 | ||
2328 | try: | 2328 | pt, created = ProjectVariable.objects.get_or_create(project = prj, name = variable) |
2329 | pt = ProjectVariable.objects.get(project = prj, name = variable) | 2329 | pt.value=value |
2330 | pt.value=value | 2330 | pt.save() |
2331 | pt.save() | ||
2332 | except ObjectDoesNotExist: | ||
2333 | print("the entry doesn't exist.") | ||
2334 | # remove conf variables | 2331 | # remove conf variables |
2335 | if 'configvarDel' in request.POST: | 2332 | if 'configvarDel' in request.POST: |
2336 | t=request.POST['configvarDel'].strip() | 2333 | t=request.POST['configvarDel'].strip() |
@@ -2338,15 +2335,32 @@ if toastermain.settings.MANAGED: | |||
2338 | 2335 | ||
2339 | # return all project settings | 2336 | # return all project settings |
2340 | vars_managed,vars_fstypes,vars_blacklist = get_project_configvars_context() | 2337 | vars_managed,vars_fstypes,vars_blacklist = get_project_configvars_context() |
2341 | return HttpResponse(json.dumps( { | 2338 | return_data = { |
2342 | "error": "ok", | 2339 | "error": "ok", |
2343 | 'configvars' : map(lambda x: (x.name, x.value, x.pk), ProjectVariable.objects.filter(project_id = pid).all()), | 2340 | 'configvars' : map(lambda x: (x.name, x.value, x.pk), ProjectVariable.objects.filter(project_id = pid).all()), |
2344 | 'distro' : ProjectVariable.objects.get(project = prj, name = "DISTRO").value, | 2341 | } |
2345 | 'fstypes' : ProjectVariable.objects.get(project = prj, name = "IMAGE_FSTYPES").value, | 2342 | try: |
2346 | 'image_install_append': ProjectVariable.objects.get(project = prj, name = "IMAGE_INSTALL_append").value, | 2343 | return_data['distro'] = ProjectVariable.objects.get(project = prj, name = "DISTRO").value, |
2347 | 'package_classes': ProjectVariable.objects.get(project = prj, name = "PACKAGE_CLASSES").value, | 2344 | except ProjectVariable.DoesNotExist: |
2348 | 'sdk_machine' : ProjectVariable.objects.get(project = prj, name = "SDKMACHINE").value, | 2345 | pass |
2349 | }), content_type = "application/json") | 2346 | try: |
2347 | return_data['fstypes'] = ProjectVariable.objects.get(project = prj, name = "IMAGE_FSTYPES").value, | ||
2348 | except ProjectVariable.DoesNotExist: | ||
2349 | pass | ||
2350 | try: | ||
2351 | return_data['image_install_append'] = ProjectVariable.objects.get(project = prj, name = "IMAGE_INSTALL_append").value, | ||
2352 | except ProjectVariable.DoesNotExist: | ||
2353 | pass | ||
2354 | try: | ||
2355 | return_data['package_classes'] = ProjectVariable.objects.get(project = prj, name = "PACKAGE_CLASSES").value, | ||
2356 | except ProjectVariable.DoesNotExist: | ||
2357 | pass | ||
2358 | try: | ||
2359 | return_data['sdk_machine'] = ProjectVariable.objects.get(project = prj, name = "SDKMACHINE").value, | ||
2360 | except ProjectVariable.DoesNotExist: | ||
2361 | pass | ||
2362 | |||
2363 | return HttpResponse(json.dumps( return_data ), content_type = "application/json") | ||
2350 | 2364 | ||
2351 | except Exception as e: | 2365 | except Exception as e: |
2352 | return HttpResponse(json.dumps({"error":str(e) + "\n" + traceback.format_exc()}), content_type = "application/json") | 2366 | return HttpResponse(json.dumps({"error":str(e) + "\n" + traceback.format_exc()}), content_type = "application/json") |
@@ -2916,7 +2930,7 @@ if toastermain.settings.MANAGED: | |||
2916 | 2930 | ||
2917 | vars_fstypes = { | 2931 | vars_fstypes = { |
2918 | 'btrfs','cpio','cpio.gz','cpio.lz4','cpio.lzma','cpio.xz','cramfs', | 2932 | 'btrfs','cpio','cpio.gz','cpio.lz4','cpio.lzma','cpio.xz','cramfs', |
2919 | 'elf','ext2','ext2.bz2','ext2.gz','ext2.lzma' 'ext3','ext3.gz','hddimg', | 2933 | 'elf','ext2','ext2.bz2','ext2.gz','ext2.lzma', 'ext3','ext3.gz','hddimg', |
2920 | 'iso','jffs2','jffs2.sum','squashfs','squashfs-lzo','squashfs-xz','tar.bz2', | 2934 | 'iso','jffs2','jffs2.sum','squashfs','squashfs-lzo','squashfs-xz','tar.bz2', |
2921 | 'tar.lz4','tar.xz','tartar.gz','ubi','ubifs','vmdk' | 2935 | 'tar.lz4','tar.xz','tartar.gz','ubi','ubifs','vmdk' |
2922 | } | 2936 | } |