aboutsummaryrefslogtreecommitdiff
path: root/library_info_lib.py
diff options
context:
space:
mode:
Diffstat (limited to 'library_info_lib.py')
-rw-r--r--library_info_lib.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/library_info_lib.py b/library_info_lib.py
index ae724ae..c67c44a 100644
--- a/library_info_lib.py
+++ b/library_info_lib.py
@@ -21,19 +21,27 @@ def get_all_configitems(full_images = True, verbose = False):
# get all checked out items
checkouts = []
reservations = []
+ card_expiration_dates = []
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)
+ card_expiration_dates.append(
+ {
+ "patron": instance.alias,
+ "expires": instance.card_expires
+ }
+ )
if not full_images:
checkouts = trim_full_images(checkouts)
reservations = trim_full_images(reservations)
- return checkouts, reservations
+ return checkouts, reservations, card_expiration_dates
def get_single_configitem(alias = None, full_images = True, verbose = False):
checkouts = []
reservations = []
+ card_expiration_dates = []
this_config = [i for i in config if i["alias"] == alias]
if not this_config:
raise Exception(f"Alias not found: {alias}")
@@ -42,10 +50,16 @@ def get_single_configitem(alias = None, full_images = True, verbose = False):
instance = i["class"](i)
checkouts += instance.get_checkouts(verbose=verbose)
reservations += instance.get_reservations(verbose=verbose)
+ card_expiration_dates.append(
+ {
+ "patron": instance.alias,
+ "expires": instance.card_expires
+ }
+ )
if not full_images:
checkouts = trim_full_images(checkouts)
reservations = trim_full_images(reservations)
- return checkouts, reservations
+ return checkouts, reservations, card_expiration_dates
def trim_full_images(checkouts = []):
output = []
bgstack15