OLD | NEW |
1 # Copyright 2009 Google Inc. All Rights Reserved. | 1 # Copyright 2009 Google Inc. All Rights Reserved. |
2 # | 2 # |
3 # Licensed under the Apache License, Version 2.0 (the "License"); | 3 # Licensed under the Apache License, Version 2.0 (the "License"); |
4 # you may not use this file except in compliance with the License. | 4 # you may not use this file except in compliance with the License. |
5 # You may obtain a copy of the License at | 5 # You may obtain a copy of the License at |
6 # | 6 # |
7 # http://www.apache.org/licenses/LICENSE-2.0 | 7 # http://www.apache.org/licenses/LICENSE-2.0 |
8 # | 8 # |
9 # Unless required by applicable law or agreed to in writing, software | 9 # Unless required by applicable law or agreed to in writing, software |
10 # distributed under the License is distributed on an "AS IS" BASIS, | 10 # distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 class Error(Exception): | 30 class Error(Exception): |
31 """gclient exception class.""" | 31 """gclient exception class.""" |
32 pass | 32 pass |
33 | 33 |
34 | 34 |
35 class CheckCallError(OSError, Error): | 35 class CheckCallError(OSError, Error): |
36 """CheckCall() returned non-0.""" | 36 """CheckCall() returned non-0.""" |
37 def __init__(self, command, cwd, returncode, stdout, stderr=None): | 37 def __init__(self, command, cwd, returncode, stdout, stderr=None): |
38 OSError.__init__(self, command, cwd, returncode, stdout, stderr) | 38 OSError.__init__(self, command, cwd, returncode, stdout, stderr) |
39 Error.__init__(self) | 39 Error.__init__(self, command) |
40 self.command = command | 40 self.command = command |
41 self.cwd = cwd | 41 self.cwd = cwd |
42 self.returncode = returncode | 42 self.returncode = returncode |
43 self.stdout = stdout | 43 self.stdout = stdout |
44 self.stderr = stderr | 44 self.stderr = stderr |
45 | 45 |
46 def __str__(self): | 46 def __str__(self): |
47 out = ' '.join(self.command) | 47 out = ' '.join(self.command) |
48 if self.cwd: | 48 if self.cwd: |
49 out += ' in ' + self.cwd | 49 out += ' in ' + self.cwd |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 if exception: | 584 if exception: |
585 self.parent.exceptions.append(exception) | 585 self.parent.exceptions.append(exception) |
586 if self.parent.progress: | 586 if self.parent.progress: |
587 self.parent.progress.update(1) | 587 self.parent.progress.update(1) |
588 assert not self.item.name in self.parent.ran | 588 assert not self.item.name in self.parent.ran |
589 if not self.item.name in self.parent.ran: | 589 if not self.item.name in self.parent.ran: |
590 self.parent.ran.append(self.item.name) | 590 self.parent.ran.append(self.item.name) |
591 finally: | 591 finally: |
592 self.parent.ready_cond.notifyAll() | 592 self.parent.ready_cond.notifyAll() |
593 self.parent.ready_cond.release() | 593 self.parent.ready_cond.release() |
OLD | NEW |