mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-07 17:24:57 +01:00
Switch to raise the error
Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
parent
8e0fb1dd2a
commit
2e92d854e0
2 changed files with 4 additions and 6 deletions
|
@ -688,8 +688,7 @@ class ArgParse(BlackList):
|
||||||
self.args.remove(arg)
|
self.args.remove(arg)
|
||||||
break
|
break
|
||||||
if tag and tag not in colors:
|
if tag and tag not in colors:
|
||||||
print(f"\nslpkg: Error: Available colors {colors}\n")
|
raise SystemExit(f"\nslpkg: Error: Available colors {colors}\n")
|
||||||
raise SystemExit(1)
|
|
||||||
if (len(self.args) == 3 and self.args[0] in options and
|
if (len(self.args) == 3 and self.args[0] in options and
|
||||||
self.args[1] in self.meta.repositories and tag in colors):
|
self.args[1] in self.meta.repositories and tag in colors):
|
||||||
PkgDesc(self.args[2], self.args[1], tag).view()
|
PkgDesc(self.args[2], self.args[1], tag).view()
|
||||||
|
@ -788,9 +787,8 @@ class ArgParse(BlackList):
|
||||||
try:
|
try:
|
||||||
from dialog import Dialog
|
from dialog import Dialog
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print("Require 'pythondialog': Install with 'slpkg -s sbo "
|
raise SystemExit("Require 'pythondialog': Install with 'slpkg "
|
||||||
"python3-pythondialog'")
|
"-s sbo python3-pythondialog'")
|
||||||
raise SystemExit(1)
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
|
@ -62,4 +62,4 @@ def sbo_list():
|
||||||
"""
|
"""
|
||||||
for pkg in os.listdir(_meta_.pkg_path):
|
for pkg in os.listdir(_meta_.pkg_path):
|
||||||
if pkg.endswith("_SBo"):
|
if pkg.endswith("_SBo"):
|
||||||
yield pkg
|
yield pkg
|
||||||
|
|
Loading…
Reference in a new issue