summaryrefslogtreecommitdiffstats
path: root/error.py
diff options
context:
space:
mode:
authorDavid Pursehouse <dpursehouse@collab.net>2020-02-12 15:20:19 +0900
committerDavid Pursehouse <dpursehouse@collab.net>2020-02-12 06:36:40 +0000
commit819827a42ddb364f98c3a1a7eae2536dc54bc4cc (patch)
treefe6bdca5ff7e44d53595a6da76d2b56ea659eee1 /error.py
parentabdf7500612f1d115863ba8f026ddbea1e5a1f28 (diff)
downloadgit-repo-819827a42ddb364f98c3a1a7eae2536dc54bc4cc.tar.gz
Fix blank line issues reported by flake8
- E301 expected 1 blank line - E302 expected 2 blank lines - E303 too many blank lines - E305 expected 2 blank lines after class or function definition - E306 expected 1 blank line before a nested definition Fixed automatically with autopep8: git ls-files | grep py$ | xargs autopep8 --in-place \ --select E301,E302,E303,E305,E306 Manually fix issues in project.py caused by misuse of block comments. Change-Id: Iee840fcaff48aae504ddac9c3e76d2acd484f6a9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254599 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
Diffstat (limited to 'error.py')
-rw-r--r--error.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/error.py b/error.py
index f22a0e75..cfed8083 100644
--- a/error.py
+++ b/error.py
@@ -14,21 +14,26 @@
14# See the License for the specific language governing permissions and 14# See the License for the specific language governing permissions and
15# limitations under the License. 15# limitations under the License.
16 16
17
17class ManifestParseError(Exception): 18class ManifestParseError(Exception):
18 """Failed to parse the manifest file. 19 """Failed to parse the manifest file.
19 """ 20 """
20 21
22
21class ManifestInvalidRevisionError(Exception): 23class ManifestInvalidRevisionError(Exception):
22 """The revision value in a project is incorrect. 24 """The revision value in a project is incorrect.
23 """ 25 """
24 26
27
25class ManifestInvalidPathError(Exception): 28class ManifestInvalidPathError(Exception):
26 """A path used in <copyfile> or <linkfile> is incorrect. 29 """A path used in <copyfile> or <linkfile> is incorrect.
27 """ 30 """
28 31
32
29class NoManifestException(Exception): 33class NoManifestException(Exception):
30 """The required manifest does not exist. 34 """The required manifest does not exist.
31 """ 35 """
36
32 def __init__(self, path, reason): 37 def __init__(self, path, reason):
33 super(NoManifestException, self).__init__() 38 super(NoManifestException, self).__init__()
34 self.path = path 39 self.path = path
@@ -37,9 +42,11 @@ class NoManifestException(Exception):
37 def __str__(self): 42 def __str__(self):
38 return self.reason 43 return self.reason
39 44
45
40class EditorError(Exception): 46class EditorError(Exception):
41 """Unspecified error from the user's text editor. 47 """Unspecified error from the user's text editor.
42 """ 48 """
49
43 def __init__(self, reason): 50 def __init__(self, reason):
44 super(EditorError, self).__init__() 51 super(EditorError, self).__init__()
45 self.reason = reason 52 self.reason = reason
@@ -47,9 +54,11 @@ class EditorError(Exception):
47 def __str__(self): 54 def __str__(self):
48 return self.reason 55 return self.reason
49 56
57
50class GitError(Exception): 58class GitError(Exception):
51 """Unspecified internal error from git. 59 """Unspecified internal error from git.
52 """ 60 """
61
53 def __init__(self, command): 62 def __init__(self, command):
54 super(GitError, self).__init__() 63 super(GitError, self).__init__()
55 self.command = command 64 self.command = command
@@ -57,9 +66,11 @@ class GitError(Exception):
57 def __str__(self): 66 def __str__(self):
58 return self.command 67 return self.command
59 68
69
60class UploadError(Exception): 70class UploadError(Exception):
61 """A bundle upload to Gerrit did not succeed. 71 """A bundle upload to Gerrit did not succeed.
62 """ 72 """
73
63 def __init__(self, reason): 74 def __init__(self, reason):
64 super(UploadError, self).__init__() 75 super(UploadError, self).__init__()
65 self.reason = reason 76 self.reason = reason
@@ -67,9 +78,11 @@ class UploadError(Exception):
67 def __str__(self): 78 def __str__(self):
68 return self.reason 79 return self.reason
69 80
81
70class DownloadError(Exception): 82class DownloadError(Exception):
71 """Cannot download a repository. 83 """Cannot download a repository.
72 """ 84 """
85
73 def __init__(self, reason): 86 def __init__(self, reason):
74 super(DownloadError, self).__init__() 87 super(DownloadError, self).__init__()
75 self.reason = reason 88 self.reason = reason
@@ -77,9 +90,11 @@ class DownloadError(Exception):
77 def __str__(self): 90 def __str__(self):
78 return self.reason 91 return self.reason
79 92
93
80class NoSuchProjectError(Exception): 94class NoSuchProjectError(Exception):
81 """A specified project does not exist in the work tree. 95 """A specified project does not exist in the work tree.
82 """ 96 """
97
83 def __init__(self, name=None): 98 def __init__(self, name=None):
84 super(NoSuchProjectError, self).__init__() 99 super(NoSuchProjectError, self).__init__()
85 self.name = name 100 self.name = name
@@ -93,6 +108,7 @@ class NoSuchProjectError(Exception):
93class InvalidProjectGroupsError(Exception): 108class InvalidProjectGroupsError(Exception):
94 """A specified project is not suitable for the specified groups 109 """A specified project is not suitable for the specified groups
95 """ 110 """
111
96 def __init__(self, name=None): 112 def __init__(self, name=None):
97 super(InvalidProjectGroupsError, self).__init__() 113 super(InvalidProjectGroupsError, self).__init__()
98 self.name = name 114 self.name = name
@@ -102,15 +118,18 @@ class InvalidProjectGroupsError(Exception):
102 return 'in current directory' 118 return 'in current directory'
103 return self.name 119 return self.name
104 120
121
105class RepoChangedException(Exception): 122class RepoChangedException(Exception):
106 """Thrown if 'repo sync' results in repo updating its internal 123 """Thrown if 'repo sync' results in repo updating its internal
107 repo or manifest repositories. In this special case we must 124 repo or manifest repositories. In this special case we must
108 use exec to re-execute repo with the new code and manifest. 125 use exec to re-execute repo with the new code and manifest.
109 """ 126 """
127
110 def __init__(self, extra_args=None): 128 def __init__(self, extra_args=None):
111 super(RepoChangedException, self).__init__() 129 super(RepoChangedException, self).__init__()
112 self.extra_args = extra_args or [] 130 self.extra_args = extra_args or []
113 131
132
114class HookError(Exception): 133class HookError(Exception):
115 """Thrown if a 'repo-hook' could not be run. 134 """Thrown if a 'repo-hook' could not be run.
116 135