Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: tools/python/google/httpd_utils.py

Issue 79017: Port page_cycler_http to Mac (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/python/google/httpd_config/httpd2_mac.conf ('k') | tools/python/google/platform_utils.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/env python 1 #!/bin/env python
2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """A class to help start/stop a local apache http server.""" 6 """A class to help start/stop a local apache http server."""
7 7
8 import logging 8 import logging
9 import optparse 9 import optparse
10 import os 10 import os
11 import subprocess 11 import subprocess
12 import sys 12 import sys
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 stdout=subprocess.PIPE, 169 stdout=subprocess.PIPE,
170 stderr=subprocess.PIPE) 170 stderr=subprocess.PIPE)
171 171
172 if '__main__' == __name__: 172 if '__main__' == __name__:
173 # Provide some command line params for starting/stopping the http server 173 # Provide some command line params for starting/stopping the http server
174 # manually. 174 # manually.
175 option_parser = optparse.OptionParser() 175 option_parser = optparse.OptionParser()
176 option_parser.add_option('-k', '--server', help='Server action (start|stop)') 176 option_parser.add_option('-k', '--server', help='Server action (start|stop)')
177 option_parser.add_option('-r', '--root', help='Document root (optional)') 177 option_parser.add_option('-r', '--root', help='Document root (optional)')
178 option_parser.add_option('-a', '--apache2', action='store_true', 178 option_parser.add_option('-a', '--apache2', action='store_true',
179 default=False, help='Starts Apache 2 instead of Apache 1.3 (default).') 179 default=False, help='Starts Apache 2 instead of Apache 1.3 (default). '
180 'Ignored on Mac (apache2 is used always)')
180 options, args = option_parser.parse_args() 181 options, args = option_parser.parse_args()
181 182
182 if not options.server: 183 if not options.server:
183 print ("Usage: %s -k {start|stop} [-r document_root] [--apache2]" % 184 print ("Usage: %s -k {start|stop} [-r document_root] [--apache2]" %
184 sys.argv[0]) 185 sys.argv[0])
185 sys.exit(0) 186 sys.exit(0)
186 187
187 document_root = None 188 document_root = None
188 if options.root: 189 if options.root:
189 document_root = options.root 190 document_root = options.root
190 191
191 if 'start' == options.server: 192 if 'start' == options.server:
192 StartServer(document_root, apache2=options.apache2) 193 StartServer(document_root, apache2=options.apache2)
193 else: 194 else:
194 StopServers(apache2=options.apache2) 195 StopServers(apache2=options.apache2)
195 196
OLDNEW
« no previous file with comments | « tools/python/google/httpd_config/httpd2_mac.conf ('k') | tools/python/google/platform_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698