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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 if pipe: | 182 if pipe: |
183 return subprocess.check_output(cmd_line, shell=True) | 183 return subprocess.check_output(cmd_line, shell=True) |
184 else: | 184 else: |
185 return subprocess.check_call(cmd_line, shell=True) | 185 return subprocess.check_call(cmd_line, shell=True) |
186 except subprocess.CalledProcessError: | 186 except subprocess.CalledProcessError: |
187 return None | 187 return None |
188 | 188 |
189 | 189 |
190 # Wrapper for side effects. | 190 # Wrapper for side effects. |
191 class SideEffectHandler(object): | 191 class SideEffectHandler(object): |
| 192 def Call(self, fun, *args, **kwargs): |
| 193 return fun(*args, **kwargs) |
| 194 |
192 def Command(self, cmd, args="", prefix="", pipe=True): | 195 def Command(self, cmd, args="", prefix="", pipe=True): |
193 return Command(cmd, args, prefix, pipe) | 196 return Command(cmd, args, prefix, pipe) |
194 | 197 |
195 def ReadLine(self): | 198 def ReadLine(self): |
196 return sys.stdin.readline().strip() | 199 return sys.stdin.readline().strip() |
197 | 200 |
198 def ReadURL(self, url, params=None): | 201 def ReadURL(self, url, params=None): |
199 # pylint: disable=E1121 | 202 # pylint: disable=E1121 |
200 url_fh = urllib2.urlopen(url, params, 60) | 203 url_fh = urllib2.urlopen(url, params, 60) |
201 try: | 204 try: |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 options, | 501 options, |
499 side_effect_handler=DEFAULT_SIDE_EFFECT_HANDLER): | 502 side_effect_handler=DEFAULT_SIDE_EFFECT_HANDLER): |
500 state = {} | 503 state = {} |
501 steps = [] | 504 steps = [] |
502 for (number, step_class) in enumerate(step_classes): | 505 for (number, step_class) in enumerate(step_classes): |
503 steps.append(MakeStep(step_class, number, state, config, | 506 steps.append(MakeStep(step_class, number, state, config, |
504 options, side_effect_handler)) | 507 options, side_effect_handler)) |
505 | 508 |
506 for step in steps[options.s:]: | 509 for step in steps[options.s:]: |
507 step.Run() | 510 step.Run() |
OLD | NEW |