Move status codes to a module and import from there

This commit is contained in:
Hugo Lopes Tavares 2011-12-04 18:50:34 -02:00
parent 0ece434f81
commit 615e724de2
3 changed files with 8 additions and 8 deletions

View File

@ -13,6 +13,8 @@ from pip.download import urlopen
from pip.exceptions import (BadCommand, InstallationError, UninstallationError,
CommandError)
from pip.backwardcompat import StringIO, walk_packages
from pip.status_codes import SUCCESS, ERROR, UNKNOWN_ERROR, VIRTUALENV_NOT_FOUND
__all__ = ['command_dict', 'Command', 'load_all_commands',
'load_command', 'command_names']
@ -22,11 +24,6 @@ command_dict = {}
# for backwards compatibiliy
get_proxy = urlopen.get_proxy
SUCCESS = 0
ERROR = 1
UNKNOWN_ERROR = 2
VIRTUALENV_NOT_FOUND = 3
class Command(object):
name = None
usage = None

View File

@ -7,12 +7,10 @@ from pip.util import get_terminal_size
from pip.log import logger
from pip.backwardcompat import xmlrpclib, reduce, cmp
from pip.exceptions import CommandError
from pip.status_codes import NO_MATCHES_FOUND
from distutils.version import StrictVersion, LooseVersion
NO_MATCHES_FOUND = 23
class SearchCommand(Command):
name = 'search'
usage = '%prog QUERY'

5
pip/status_codes.py Normal file
View File

@ -0,0 +1,5 @@
SUCCESS = 0
ERROR = 1
UNKNOWN_ERROR = 2
VIRTUALENV_NOT_FOUND = 3
NO_MATCHES_FOUND = 23