From 64ce365acfbe4f617f18e2b1de26930fe3010bcd Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 12 Jan 2022 23:08:00 +0000 Subject: fixed searching --- src/verbs/search.py | 2 ++ src/verbs/sync.py | 20 ++++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/verbs/search.py b/src/verbs/search.py index b67f5a1..498a88e 100644 --- a/src/verbs/search.py +++ b/src/verbs/search.py @@ -28,9 +28,11 @@ def search(args, options, config): for r in results: print(colors.LIGHT_GREEN + f"\t{r}") + print(colors.RESET, end="") sys.exit(0) else: print(colors.RED + f"Package {package} could not be found") + print(colors.RESET, end="") sys.exit(1) else: print(colors.LIGHT_RED + "Nothing to do") diff --git a/src/verbs/sync.py b/src/verbs/sync.py index 53fcfb4..70adcd1 100644 --- a/src/verbs/sync.py +++ b/src/verbs/sync.py @@ -65,12 +65,20 @@ def validate_package(package, versions, repo, verbose=False): # change the packages dict to list all the sources # maybe some validation here - info = { - "checksum": most_popular.split()[0], - "size": most_popular.split()[1], - "files": most_popular.split()[2], - "sources" : sources - } + if len(most_popular.split()) > 2: + info = { + "checksum": most_popular.split()[0], + "size": most_popular.split()[1], + "files": most_popular.split()[2], + "sources" : sources + } + else: + info = { + "checksum": most_popular.split()[0], + "size": "0", + "files": "0", + "sources" : sources + } return info def save_package(package, info, location): -- cgit v1.2.1