| OLD | NEW |
| 1 """SCons.Executor | 1 """SCons.Executor |
| 2 | 2 |
| 3 A module for executing actions with specific lists of target and source | 3 A module for executing actions with specific lists of target and source |
| 4 Nodes. | 4 Nodes. |
| 5 | 5 |
| 6 """ | 6 """ |
| 7 | 7 |
| 8 # | 8 # |
| 9 # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundat
ion | 9 # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundat
ion |
| 10 # | 10 # |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 # | 21 # |
| 22 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY | 22 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY |
| 23 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE | 23 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE |
| 24 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | 24 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 25 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | 25 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
| 26 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | 26 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
| 27 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | 27 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
| 28 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | 28 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 29 # | 29 # |
| 30 | 30 |
| 31 __revision__ = "src/engine/SCons/Executor.py 3603 2008/10/10 05:46:45 scons" | 31 __revision__ = "src/engine/SCons/Executor.py 3842 2008/12/20 22:59:52 scons" |
| 32 | 32 |
| 33 import string | 33 import string |
| 34 | 34 |
| 35 from SCons.Debug import logInstanceCreation | 35 from SCons.Debug import logInstanceCreation |
| 36 import SCons.Errors | 36 import SCons.Errors |
| 37 import SCons.Memoize | 37 import SCons.Memoize |
| 38 | 38 |
| 39 | 39 |
| 40 class Executor: | 40 class Executor: |
| 41 """A class for controlling instances of executing an action. | 41 """A class for controlling instances of executing an action. |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 env = self.get_build_env() | 127 env = self.get_build_env() |
| 128 kw = self.get_kw(kw) | 128 kw = self.get_kw(kw) |
| 129 status = 0 | 129 status = 0 |
| 130 for act in self.get_action_list(): | 130 for act in self.get_action_list(): |
| 131 status = apply(act, (self.targets, self.get_sources(), env), kw) | 131 status = apply(act, (self.targets, self.get_sources(), env), kw) |
| 132 if isinstance(status, SCons.Errors.BuildError): | 132 if isinstance(status, SCons.Errors.BuildError): |
| 133 status.executor = self | 133 status.executor = self |
| 134 raise status | 134 raise status |
| 135 elif status: | 135 elif status: |
| 136 msg = "Error %s" % status | 136 msg = "Error %s" % status |
| 137 raise SCons.Errors.BuildError(errstr=msg, executor=self, action=
act) | 137 raise SCons.Errors.BuildError( |
| 138 errstr=msg, |
| 139 node=self.targets, |
| 140 executor=self, |
| 141 action=act) |
| 138 return status | 142 return status |
| 139 | 143 |
| 140 # use extra indirection because with new-style objects (Python 2.2 | 144 # use extra indirection because with new-style objects (Python 2.2 |
| 141 # and above) we can't override special methods, and nullify() needs | 145 # and above) we can't override special methods, and nullify() needs |
| 142 # to be able to do this. | 146 # to be able to do this. |
| 143 | 147 |
| 144 def __call__(self, target, **kw): | 148 def __call__(self, target, **kw): |
| 145 return self.do_execute(target, kw) | 149 return self.do_execute(target, kw) |
| 146 | 150 |
| 147 def cleanup(self): | 151 def cleanup(self): |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 self._morph() | 384 self._morph() |
| 381 self.add_pre_action(action) | 385 self.add_pre_action(action) |
| 382 def add_post_action(self, action): | 386 def add_post_action(self, action): |
| 383 self._morph() | 387 self._morph() |
| 384 self.add_post_action(action) | 388 self.add_post_action(action) |
| 385 def set_action_list(self, action): | 389 def set_action_list(self, action): |
| 386 self._morph() | 390 self._morph() |
| 387 self.set_action_list(action) | 391 self.set_action_list(action) |
| 388 | 392 |
| 389 | 393 |
| OLD | NEW |