summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster')
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index da73d43c4f..65b38d0645 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -2527,14 +2527,24 @@ if True:
2527 "not found" % package_id} 2527 "not found" % package_id}
2528 2528
2529 if request.method == 'GET': 2529 if request.method == 'GET':
2530 # If no package_id then list the current packages
2530 if not package_id: 2531 if not package_id:
2532 total_size = 0
2531 packages = recipe.get_all_packages().values("id", 2533 packages = recipe.get_all_packages().values("id",
2532 "name", 2534 "name",
2533 "version") 2535 "version",
2536 "size")
2537 for package in packages:
2538 package['size_formatted'] = \
2539 filtered_filesizeformat(package['size'])
2540 total_size += package['size']
2534 2541
2535 return {"error": "ok", 2542 return {"error": "ok",
2536 "packages" : list(packages), 2543 "packages" : list(packages),
2537 "total" : len(packages) 2544 "total" : len(packages),
2545 "total_size" : total_size,
2546 "total_size_formatted" :
2547 filtered_filesizeformat(total_size)
2538 } 2548 }
2539 else: 2549 else:
2540 all_current_packages = recipe.get_all_packages() 2550 all_current_packages = recipe.get_all_packages()