def __init__(self, error_info, msg_args=None, option_parser=None): UserError.__init__(self, error_info, msg_args=msg_args) self.option_parser = option_parser if self.option_parser: self.command_args = \ self.option_parser.usage.replace("%prog", os.path.basename(sys.argv[0])) self.context = ["Usage: " + self.command_args]
def __init__(self, error_id, action, config, msg_args=None, developer_msg=None): context = ["%s of %s, instance %s" % (action, config.package_name, config.id)] UserError.__init__(self, errors[error_id], msg_args, developer_msg, context)
def __init__(self, error_id, action, config, msg_args=None, developer_msg=None): context = ["%s of %s, instance %s" % (action, config.package_name, config.id)] UserError.__init__(self, errors[error_id], msg_args, developer_msg, context) self.config = config # keep this around just in case we want it later
def __init__(self, error_info, msg_args=None, developer_msg=None, context=None): UserError.__init__(self, error_info, msg_args, developer_msg, context) self.resource_id = None