@@ -0,0 +1,2246 @@
+# Copyright (c) 2011-2015 Rackspace US, Inc.%0A#%0A# All Rights Reserved.%0A#    Licensed under the Apache License, Version 2.0 (the %22License%22); you may%0A#    not use this file except in compliance with the License. You may obtain%0A#    a copy of the License at%0A#%0A#         http://www.apache.org/licenses/LICENSE-2.0%0A#%0A#    Unless required by applicable law or agreed to in writing, software%0A#    distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A#    License for the specific language governing permissions and limitations%0A#    under the License.%0A#%0A%0A%0Aclass SimplException(Exception):%0A%0A    %22%22%22Base exception for all exceptions raised by the simpl package.%22%22%22%0A%0A%0A# TODO(sam): add SimpleConfigException and NoGroupForOption%0A%0A%0Aclass SimplGitError(SimplException):%0A%0A    %22%22%22Base class for errors from the git module.%22%22%22%0A%0A%0Aclass SimplGitCommandError(SimplGitError):%0A%0A    def __init__(self, returncode, cmd, output=None, oserror=None):%0A        self.returncode = returncode%0A        self.cmd = cmd%0A        self.output = output%0A        self.oserror = oserror%0A%0A    def __str__(self):%0A        return (%22The command %60%25s%60 returned non-zero exit status %25d and %22%0A                %22produced the following output: %5C%22%25s%5C%22%22%0A                %25 (self.cmd, self.returncode, self.output))%0A%0A    def __repr__(self):%0A        rpr = ('SimplGitCommandError(%25d, %60%25s%60, output=%22%25s%22'%0A               %25 (self.returncode, self.cmd, self.output))%0A        if self.oserror:%0A            rpr += ', oserror=%25s' %25 repr(self.oserror)%0A        rpr += ')'%0A        return rpr%0A%0A%0Aclass SimplGitNotRepo(SimplGitError):%0A%0A    %22%22%22The directory supplied is not a git repo.%22%22%22%0A%0A%0Aclass SimplCalledProcessError(SimplException):%0A    %22%22%22Raised when a process run by execute() returns non-zero.%0A%0A    The exit status will be stored in the returncode attribute;%0A    check_output() will also store the output in the output attribute.%0A    %22%22%22%0A    def __init__(self, returncode, cmd, output=None):%0A        self.returncode = returncode%0A        self.cmd = cmd%0A        self.output = output%0A    def __str__(self):%0A        return (%22Command '%25s' returned non-zero exit status %25d%22%0A                %25 (self.cmd, self.returncode))%0A%0A%0A

add exceptions module