OLD | NEW |
1 # Copyright (C) 2011 Google Inc. All rights reserved. | 1 # Copyright (C) 2011 Google Inc. All rights reserved. |
2 # | 2 # |
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 # 1. Redistributions of source code must retain the above copyright | 7 # 1. 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 # 2. Redistributions in binary form must reproduce the above copyright | 9 # 2. Redistributions in binary form must reproduce the above copyright |
10 # notice, this list of conditions and the following disclaimer in the | 10 # notice, this list of conditions and the following disclaimer in the |
(...skipping 12 matching lines...) Expand all Loading... |
23 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 | 24 |
25 from webkitpy.layout_tests.port import builders | 25 from webkitpy.layout_tests.port import builders |
26 from webkitpy.tool.commands.rebaseline import AbstractRebaseliningCommand | 26 from webkitpy.tool.commands.rebaseline import AbstractRebaseliningCommand |
27 from webkitpy.tool.servers.gardeningserver import GardeningHTTPServer | 27 from webkitpy.tool.servers.gardeningserver import GardeningHTTPServer |
28 | 28 |
29 | 29 |
30 class GardenOMatic(AbstractRebaseliningCommand): | 30 class GardenOMatic(AbstractRebaseliningCommand): |
31 name = "garden-o-matic" | 31 name = "garden-o-matic" |
32 help_text = "Command for gardening the WebKit tree." | 32 help_text = "Command for gardening the WebKit tree." |
| 33 show_in_main_help = True |
33 | 34 |
34 def __init__(self): | 35 def __init__(self): |
35 super(GardenOMatic, self).__init__(options=(self.platform_options + [ | 36 super(GardenOMatic, self).__init__(options=(self.platform_options + [ |
36 self.results_directory_option, | 37 self.results_directory_option, |
37 self.no_optimize_option, | 38 self.no_optimize_option, |
38 ])) | 39 ])) |
39 | 40 |
40 def execute(self, options, args, tool): | 41 def execute(self, options, args, tool): |
41 print "This command runs a local HTTP server that changes your working c
opy" | 42 print "This command runs a local HTTP server that changes your working c
opy" |
42 print "based on the actions you take in the web-based UI." | 43 print "based on the actions you take in the web-based UI." |
43 | 44 |
44 args = {} | 45 args = {} |
45 if options.platform: | 46 if options.platform: |
46 # FIXME: This assumes that the port implementation (chromium-, gtk-,
etc.) is the first part of options.platform. | 47 # FIXME: This assumes that the port implementation (chromium-, gtk-,
etc.) is the first part of options.platform. |
47 args['platform'] = options.platform.split('-')[0] | 48 args['platform'] = options.platform.split('-')[0] |
48 builder = builders.builder_name_for_port_name(options.platform) | 49 builder = builders.builder_name_for_port_name(options.platform) |
49 if builder: | 50 if builder: |
50 args['builder'] = builder | 51 args['builder'] = builder |
51 if options.results_directory: | 52 if options.results_directory: |
52 args['useLocalResults'] = "true" | 53 args['useLocalResults'] = "true" |
53 | 54 |
54 httpd = GardeningHTTPServer(httpd_port=8127, config={'tool': tool, 'opti
ons': options}) | 55 httpd = GardeningHTTPServer(httpd_port=8127, config={'tool': tool, 'opti
ons': options}) |
55 self._tool.user.open_url(httpd.url(args)) | 56 self._tool.user.open_url(httpd.url(args)) |
56 | 57 |
57 print "Local HTTP server started." | 58 print "Local HTTP server started." |
58 httpd.serve_forever() | 59 httpd.serve_forever() |
OLD | NEW |