diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui')
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index d29ddd6099..03c7507762 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -102,8 +102,7 @@ def _project_recent_build_list(prj): | |||
102 | 102 | ||
103 | def objtojson(obj): | 103 | def objtojson(obj): |
104 | from django.db.models.query import QuerySet | 104 | from django.db.models.query import QuerySet |
105 | from django.db.models import Model, IntegerField | 105 | from django.db.models import Model |
106 | from django.db.models.fields.related import ForeignKey | ||
107 | 106 | ||
108 | if isinstance(obj, datetime): | 107 | if isinstance(obj, datetime): |
109 | return obj.isoformat() | 108 | return obj.isoformat() |
@@ -266,8 +265,8 @@ def _get_filtering_query(filter_string): | |||
266 | 265 | ||
267 | return reduce(operator.and_, [k for k in and_query]) | 266 | return reduce(operator.and_, [k for k in and_query]) |
268 | 267 | ||
269 | def _get_toggle_order(request, orderkey, reverse = False): | 268 | def _get_toggle_order(request, orderkey, toggle_reverse = False): |
270 | if reverse: | 269 | if toggle_reverse: |
271 | return "%s:+" % orderkey if request.GET.get('orderby', "") == "%s:-" % orderkey else "%s:-" % orderkey | 270 | return "%s:+" % orderkey if request.GET.get('orderby', "") == "%s:-" % orderkey else "%s:-" % orderkey |
272 | else: | 271 | else: |
273 | return "%s:-" % orderkey if request.GET.get('orderby', "") == "%s:+" % orderkey else "%s:+" % orderkey | 272 | return "%s:-" % orderkey if request.GET.get('orderby', "") == "%s:+" % orderkey else "%s:+" % orderkey |
@@ -912,9 +911,7 @@ def _get_dir_entries(build_id, target_id, start): | |||
912 | 911 | ||
913 | except Exception as e: | 912 | except Exception as e: |
914 | print "Exception ", e | 913 | print "Exception ", e |
915 | import traceback | ||
916 | traceback.print_exc(e) | 914 | traceback.print_exc(e) |
917 | pass | ||
918 | 915 | ||
919 | # sort by directories first, then by name | 916 | # sort by directories first, then by name |
920 | rsorted = sorted(response, key=lambda entry : entry['name']) | 917 | rsorted = sorted(response, key=lambda entry : entry['name']) |
@@ -938,7 +935,7 @@ def dirinfo(request, build_id, target_id, file_path=None): | |||
938 | dir_list = [] | 935 | dir_list = [] |
939 | head = file_path | 936 | head = file_path |
940 | while head != sep: | 937 | while head != sep: |
941 | (head,tail) = os.path.split(head) | 938 | (head, tail) = os.path.split(head) |
942 | if head != sep: | 939 | if head != sep: |
943 | dir_list.insert(0, head) | 940 | dir_list.insert(0, head) |
944 | 941 | ||
@@ -1839,7 +1836,6 @@ def image_information_dir(request, build_id, target_id, packagefile_id): | |||
1839 | 1836 | ||
1840 | 1837 | ||
1841 | def managedcontextprocessor(request): | 1838 | def managedcontextprocessor(request): |
1842 | import subprocess | ||
1843 | ret = { | 1839 | ret = { |
1844 | "projects": Project.objects.all(), | 1840 | "projects": Project.objects.all(), |
1845 | "DEBUG" : toastermain.settings.DEBUG, | 1841 | "DEBUG" : toastermain.settings.DEBUG, |
@@ -1867,13 +1863,9 @@ if True: | |||
1867 | 1863 | ||
1868 | import traceback | 1864 | import traceback |
1869 | 1865 | ||
1870 | class BadParameterException(Exception): pass # error thrown on invalid POST requests | 1866 | class BadParameterException(Exception): |
1871 | 1867 | ''' The exception raised on invalid POST requests ''' | |
1872 | 1868 | pass | |
1873 | class InvalidRequestException(Exception): | ||
1874 | def __init__(self, response): | ||
1875 | self.response = response | ||
1876 | |||
1877 | 1869 | ||
1878 | # shows the "all builds" page for managed mode; it displays build requests (at least started!) instead of actual builds | 1870 | # shows the "all builds" page for managed mode; it displays build requests (at least started!) instead of actual builds |
1879 | @_template_renderer("builds.html") | 1871 | @_template_renderer("builds.html") |
@@ -2476,7 +2468,7 @@ if True: | |||
2476 | try: | 2468 | try: |
2477 | layer_version_id = request.POST["layer_version_id"] | 2469 | layer_version_id = request.POST["layer_version_id"] |
2478 | layer_version = Layer_Version.objects.get(id=layer_version_id) | 2470 | layer_version = Layer_Version.objects.get(id=layer_version_id) |
2479 | except: | 2471 | except Layer_Version.DoesNotExist: |
2480 | return error_response("Cannot find layer to update") | 2472 | return error_response("Cannot find layer to update") |
2481 | 2473 | ||
2482 | 2474 | ||
@@ -2505,8 +2497,8 @@ if True: | |||
2505 | try: | 2497 | try: |
2506 | layer_version.layer.save() | 2498 | layer_version.layer.save() |
2507 | layer_version.save() | 2499 | layer_version.save() |
2508 | except: | 2500 | except Exception as e: |
2509 | return error_response("Could not update layer version entry") | 2501 | return error_response("Could not update layer version entry: %s" % e) |
2510 | 2502 | ||
2511 | return HttpResponse(jsonfilter({"error": "ok",}), content_type = "application/json") | 2503 | return HttpResponse(jsonfilter({"error": "ok",}), content_type = "application/json") |
2512 | 2504 | ||