summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Dolbec <brian.dolbec@gmail.com>2011-02-13 16:53:33 -0800
committerBrian Dolbec <brian.dolbec@gmail.com>2011-02-13 16:53:33 -0800
commitcc15f2551e105540850101572ccba275a6fc1ace (patch)
tree784b9458ae0f80f6b7ee9de5d1313aaa0b61245c
parent69ca817b92d78e91b03ee3e327b9e369c8f26e5a (diff)
downloadlayman-cc15f2551e105540850101572ccba275a6fc1ace.tar.gz
layman-cc15f2551e105540850101572ccba275a6fc1ace.tar.bz2
layman-cc15f2551e105540850101572ccba275a6fc1ace.zip
fix the incorrect exit code settings which are opposite the True/False that the api returns
-rw-r--r--layman/cli.py7
-rw-r--r--layman/constants.py3
2 files changed, 7 insertions, 3 deletions
diff --git a/layman/cli.py b/layman/cli.py
index 3277c1b..8f94f4a 100644
--- a/layman/cli.py
+++ b/layman/cli.py
@@ -27,7 +27,8 @@ import os, sys
from layman.api import LaymanAPI
from layman.utils import (decode_selection, encoder, get_encoding,
pad, terminal_width)
-from layman.constants import NOT_OFFICIAL_MSG, NOT_SUPPORTED_MSG
+from layman.constants import (NOT_OFFICIAL_MSG, NOT_SUPPORTED_MSG,
+ FAILURE, SUCCEED)
@@ -180,9 +181,9 @@ class Main(object):
os.umask(old_umask)
if not result:
- sys.exit(0)
+ sys.exit(FAILURE)
else:
- sys.exit(1)
+ sys.exit(SUCCEED)
def Fetch(self):
diff --git a/layman/constants.py b/layman/constants.py
index 6962867..6f53de3 100644
--- a/layman/constants.py
+++ b/layman/constants.py
@@ -50,3 +50,6 @@ WARN_LEVEL = 4
INFO_LEVEL = 4
DEBUG_LEVEL = 4
DEBUG_VERBOSITY = 2
+
+FAILURE = 1
+SUCCEED = 0