From 6c1db4e05d51e93826abba25128ce6824b2f2731 Mon Sep 17 00:00:00 2001 From: Kevin Fong Date: Thu, 1 Sep 2016 01:48:04 -0700 Subject: [PATCH 1/2] Update preliminary functionality to open a range of search results --- buku | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buku b/buku index 1095cd2..64b02d8 100755 --- a/buku +++ b/buku @@ -1287,10 +1287,10 @@ def prompt(results, noninteractive=False, delete=False): except Exception as e: _, _, linenumber, func, _, _ = inspect.stack()[0] logger.error('%s(), ln %d: %s', func, linenumber, e) - elif "-" in nav and is_int(nav.split("-")[0]) and is_int(nav.split("-")[1]): + elif "-" in nav and is_int(nav.split("-")[0]) and is_int(nav.split("-")[1]): lower = int(nav.split("-")[0]) upper = int(nav.split("-")[1]) - for index in range(lower-1,upper-1): + for index in range(lower-1,upper): try: browser_open(unquote(results[index][1])) except Exception as e: From f3ed7fcf31c0dea3e385955e89b36c251891a7c3 Mon Sep 17 00:00:00 2001 From: Kevin Fong Date: Thu, 1 Sep 2016 01:49:41 -0700 Subject: [PATCH 2/2] Add preliminary functionality to open array of search results --- buku | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/buku b/buku index 64b02d8..79d6976 100755 --- a/buku +++ b/buku @@ -1296,6 +1296,13 @@ def prompt(results, noninteractive=False, delete=False): except Exception as e: _, _, linenumber, func, _, _ = inspect.stack()[0] logger.error('%s(), ln %d: %s', func, linenumber, e) + elif " " in nav and is_int(nav.split(" ")[0]) and is_int(nav.split(" ")[1]): + for index in nav.strip().split(' '): + try: + browser_open(unquote(results[int(index)-1][1])) + except Exception as e: + _, _, linenumber, func, _, _ = inspect.stack()[0] + logger.error('%s(), ln %d: %s', func, linenumber, e) else: break