OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2013 the V8 project authors. All rights reserved. | 2 # Copyright 2013 the V8 project authors. All rights reserved. |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following | 10 # copyright notice, this list of conditions and the following |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 message = step_class.MESSAGE | 593 message = step_class.MESSAGE |
594 except AttributeError: | 594 except AttributeError: |
595 message = step_class.__name__ | 595 message = step_class.__name__ |
596 | 596 |
597 return step_class(message, number=number, config=config, | 597 return step_class(message, number=number, config=config, |
598 state=state, options=options, | 598 state=state, options=options, |
599 handler=side_effect_handler) | 599 handler=side_effect_handler) |
600 | 600 |
601 | 601 |
602 class ScriptsBase(object): | 602 class ScriptsBase(object): |
603 # TODO(machenbach): Move static config here. | |
604 def __init__(self, | 603 def __init__(self, |
605 config=None, | 604 config=None, |
606 side_effect_handler=DEFAULT_SIDE_EFFECT_HANDLER, | 605 side_effect_handler=DEFAULT_SIDE_EFFECT_HANDLER, |
607 state=None): | 606 state=None): |
608 self._config = config or self._Config() | 607 self._config = config or self._Config() |
609 self._side_effect_handler = side_effect_handler | 608 self._side_effect_handler = side_effect_handler |
610 self._state = state if state is not None else {} | 609 self._state = state if state is not None else {} |
611 | 610 |
612 def _Description(self): | 611 def _Description(self): |
613 return None | 612 return None |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 for (number, step_class) in enumerate(step_classes): | 696 for (number, step_class) in enumerate(step_classes): |
698 steps.append(MakeStep(step_class, number, self._state, self._config, | 697 steps.append(MakeStep(step_class, number, self._state, self._config, |
699 options, self._side_effect_handler)) | 698 options, self._side_effect_handler)) |
700 for step in steps[options.step:]: | 699 for step in steps[options.step:]: |
701 if step.Run(): | 700 if step.Run(): |
702 return 0 | 701 return 0 |
703 return 0 | 702 return 0 |
704 | 703 |
705 def Run(self, args=None): | 704 def Run(self, args=None): |
706 return self.RunSteps(self._Steps(), args) | 705 return self.RunSteps(self._Steps(), args) |
OLD | NEW |