logging_setup = False
-class Error(wizard.Error):
- """Base error class for all command errors"""
- pass
-
-class PermissionsError(Error):
- def __init__(self, dir):
- self.dir = dir
- def __str__(self):
- return """
-
-ERROR: You don't have permissions to access this directory.
-Do you have tokens for AFS with your root instance, and
-is your root instance on scripts-security-upd?
-
-You can check by running the commands 'klist' and
-'blanche scripts-security-upd'.
-"""
-
-class NoSuchDirectoryError(Error):
- def __init__(self, dir):
- self.dir = dir
- def __str__(self):
- return """
-
-ERROR: No such directory... check your typing
-"""
-
def boolish(val):
"""
Parse the contents of an environment variable as a boolean.
return False
return bool(val)
-def chdir(dir):
- try:
- os.chdir(dir)
- except OSError as e:
- if e.errno == errno.EACCES:
- raise PermissionsError(dir)
- elif e.errno == errno.ENOENT:
- raise NoSuchDirectoryError(dir)
- else: raise e
-
def makeLogger(options, numeric_args):
global logging_setup
if logging_setup: return logging.getLogger()
"""Hands off parameters to option parser"""
for key in args:
option_parser.add_option(self.store[key])
+
+class Error(wizard.Error):
+ """Base error class for all command errors"""
+ pass