From cc15f2551e105540850101572ccba275a6fc1ace Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Sun, 13 Feb 2011 16:53:33 -0800 Subject: fix the incorrect exit code settings which are opposite the True/False that the api returns --- layman/cli.py | 7 ++++--- layman/constants.py | 3 +++ 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 -- cgit v1.2.3-1-g7c22