From f5d11b750ecc982541d1f936488248f0b42d75d3 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sun, 16 Nov 2014 20:15:50 +0100 Subject: pep8 linting (whitespaces) W191 indentation contains tabs E221 multiple spaces before operator E222 multiple spaces after operator E225 missing whitespace around operator E271 multiple spaces after keyword W292 no newline at end of file W293 blank line contains whitespace W391 blank line at end of file --- git/exc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'git/exc.py') diff --git a/git/exc.py b/git/exc.py index 76d3d486..fac7cde5 100644 --- a/git/exc.py +++ b/git/exc.py @@ -22,7 +22,7 @@ class GitCommandError(Exception): self.stdout = stdout self.status = status self.command = command - + def __str__(self): ret = "'%s' returned exit status %i: %s" % \ (' '.join(str(i) for i in self.command), self.status, self.stderr) @@ -52,8 +52,8 @@ class CheckoutError( Exception ): def __str__(self): return Exception.__str__(self) + ":%s" % self.failed_files - - + + class CacheError(Exception): """Base for all errors related to the git index, which is called cache internally""" -- cgit v1.2.3 From be34ec23c48d6d5d8fd2ef4491981f6fb4bab8e6 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sun, 16 Nov 2014 20:51:04 +0100 Subject: pep8 linting (blank lines expectations) E301 expected 1 blank line, found 0 E302 expected 2 blank lines, found 1 E303 too many blank lines (n) --- git/exc.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'git/exc.py') diff --git a/git/exc.py b/git/exc.py index fac7cde5..db78853e 100644 --- a/git/exc.py +++ b/git/exc.py @@ -7,16 +7,21 @@ from gitdb.exc import * + class InvalidGitRepositoryError(Exception): + """ Thrown if the given repository appears to have an invalid format. """ class NoSuchPathError(OSError): + """ Thrown if a path could not be access by the system. """ class GitCommandError(Exception): + """ Thrown if execution of the git command fails with non-zero status code. """ + def __init__(self, command, status, stderr=None, stdout=None): self.stderr = stderr self.stdout = stdout @@ -32,6 +37,7 @@ class GitCommandError(Exception): class CheckoutError( Exception ): + """Thrown if a file could not be checked out from the index as it contained changes. @@ -44,6 +50,7 @@ class CheckoutError( Exception ): The .valid_files attribute contains a list of relative paths to files that were checked out successfully and hence match the version stored in the index""" + def __init__(self, message, failed_files, valid_files, failed_reasons): Exception.__init__(self, message) self.failed_files = failed_files @@ -55,8 +62,11 @@ class CheckoutError( Exception ): class CacheError(Exception): + """Base for all errors related to the git index, which is called cache internally""" + class UnmergedEntriesError(CacheError): + """Thrown if an operation cannot proceed as there are still unmerged entries in the cache""" -- cgit v1.2.3 From 614907b7445e2ed8584c1c37df7e466e3b56170f Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sun, 16 Nov 2014 20:56:53 +0100 Subject: pep8 linting (whitespace before/after) E201 whitespace after '(' E202 whitespace before ')' E203 whitespace before ':' E225 missing whitespace around operator E226 missing whitespace around arithmetic operator E227 missing whitespace around bitwise or shift operator E228 missing whitespace around modulo operator E231 missing whitespace after ',' E241 multiple spaces after ',' E251 unexpected spaces around keyword / parameter equals --- git/exc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git/exc.py') diff --git a/git/exc.py b/git/exc.py index db78853e..feae0954 100644 --- a/git/exc.py +++ b/git/exc.py @@ -36,7 +36,7 @@ class GitCommandError(Exception): return ret -class CheckoutError( Exception ): +class CheckoutError(Exception): """Thrown if a file could not be checked out from the index as it contained changes. -- cgit v1.2.3 From c8e70749887370a99adeda972cc3503397b5f9a7 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sun, 16 Nov 2014 21:09:47 +0100 Subject: pep8 linting (trailing whitespace) W291 trailing whitespace --- git/exc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git/exc.py') diff --git a/git/exc.py b/git/exc.py index feae0954..f1fcf9b3 100644 --- a/git/exc.py +++ b/git/exc.py @@ -68,5 +68,5 @@ class CacheError(Exception): class UnmergedEntriesError(CacheError): - """Thrown if an operation cannot proceed as there are still unmerged + """Thrown if an operation cannot proceed as there are still unmerged entries in the cache""" -- cgit v1.2.3