From 684b84c78cf65c767ffcf077ed7f89106a1acf26 Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Wed, 10 Jul 2024 23:07:49 -0400 Subject: use reservations in all get_ calls --- library_info_lib.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'library_info_lib.py') diff --git a/library_info_lib.py b/library_info_lib.py index 202ec71..ae724ae 100644 --- a/library_info_lib.py +++ b/library_info_lib.py @@ -17,19 +17,23 @@ import sys, os import libraries from config import config -def get_all_checkouts(full_images = True, verbose = False): +def get_all_configitems(full_images = True, verbose = False): # get all checked out items checkouts = [] + reservations = [] for i in config: #print(f"Found config entry {i}") instance = i["class"](i) checkouts += instance.get_checkouts(verbose = verbose) + reservations += instance.get_reservations(verbose=verbose) if not full_images: checkouts = trim_full_images(checkouts) - return checkouts + reservations = trim_full_images(reservations) + return checkouts, reservations -def get_single_checkouts(alias = None, full_images = True, verbose = False): +def get_single_configitem(alias = None, full_images = True, verbose = False): checkouts = [] + reservations = [] this_config = [i for i in config if i["alias"] == alias] if not this_config: raise Exception(f"Alias not found: {alias}") @@ -37,9 +41,11 @@ def get_single_checkouts(alias = None, full_images = True, verbose = False): for i in this_config: instance = i["class"](i) checkouts += instance.get_checkouts(verbose=verbose) + reservations += instance.get_reservations(verbose=verbose) if not full_images: checkouts = trim_full_images(checkouts) - return checkouts + reservations = trim_full_images(reservations) + return checkouts, reservations def trim_full_images(checkouts = []): output = [] -- cgit