diff options
author | davidovski <david@davidovski.xyz> | 2022-02-13 23:22:33 +0000 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-02-13 23:22:33 +0000 |
commit | 9f529b0e85c7b38e97d8ebb0371f7a6859f882f4 (patch) | |
tree | 8de89a716bce066a5497b8263a00d9c007425e85 /src/verbs/search.py | |
parent | f545930c0535293a37f5c1730d8b83264cf098b5 (diff) |
started rewrite with xisync
Diffstat (limited to 'src/verbs/search.py')
-rw-r--r-- | src/verbs/search.py | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/verbs/search.py b/src/verbs/search.py deleted file mode 100644 index 498a88e..0000000 --- a/src/verbs/search.py +++ /dev/null @@ -1,40 +0,0 @@ -import os -import sys -import colors -import util -import shutil - -from verbs.install import find_package, retrieve_package_info -from verbs.sync import sync - -def list_repos(repos, packages_dir, sources): - return [ - f"{repo}/{file}" for repo in repos for file in os.listdir(os.path.join(packages_dir, repo)) - ] - -def search(args, options, config): - if not options["l"]: - sync(args, options, config) - - if len(args) > 0: - packages = list_repos(config["repos"], config["dir"]["packages"], config["sources"]) - for package in args: - - # TODO fuzzy searching here - results = [p for p in packages if package.lower() in p.lower()] - - if len(results) > 0: - print(colors.GREEN + f"Search results for {package}:") - 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") - - |