From c232fd546b3841a837a1f0dc7812d5edeb4cb20b Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Sat, 24 Dec 2022 04:08:23 +0300 Subject: [PATCH] Fix next/prev page in libraries (O_o) --- src/fw_libraries.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fw_libraries.py b/src/fw_libraries.py index ba766ec..8fb9c14 100644 --- a/src/fw_libraries.py +++ b/src/fw_libraries.py @@ -5,12 +5,13 @@ from loguru import logger fzf = FzfPrompt() +@logger.catch def libraries(pg=None): libs_res = list_libraries(pg=pg) libs_count = libs_res.get('count') libs_next = libs_res.get('next') libs_prev = libs_res.get('previous') - libs = list_libraries()['results'] + libs = libs_res.get('results') libraries_listing = [] if libs_next: libraries_listing.append('Next') @@ -24,9 +25,9 @@ def libraries(pg=None): lib_select = fzf.prompt( libraries_listing, f'--header=\'found {libs_count} libraries\'')[0].split('.', 1) if lib_select[0] == 'Next': - libraries(pg=libs_next) + return libraries(pg=libs_next) elif lib_select[0] == 'Prev': - libraries(pg=libs_prev) + return libraries(pg=libs_prev) else: lib_addr = lib_select[0] lib_name = lib_select[1]