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

Unified Diff: tools/python/google/httpd_utils.py

Issue 8678023: Fix python scripts in src/tools/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/python/google/gethash_timer.py ('k') | tools/python/google/logging_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/python/google/httpd_utils.py
diff --git a/tools/python/google/httpd_utils.py b/tools/python/google/httpd_utils.py
old mode 100644
new mode 100755
index e7cfe09d9b0c0f2f2acc08adcd845ec2e9f9dcad..4a03ffc7fb0c4f7167238b77a6f49a16c7ebbf4f
--- a/tools/python/google/httpd_utils.py
+++ b/tools/python/google/httpd_utils.py
@@ -1,5 +1,5 @@
-#!/bin/env python
-# Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+#!/usr/bin/env python
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -169,7 +169,8 @@ class ApacheHttpd(object):
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
-if '__main__' == __name__:
+
+def main():
# Provide some command line params for starting/stopping the http server
# manually.
option_parser = optparse.OptionParser()
@@ -183,7 +184,7 @@ if '__main__' == __name__:
if not options.server:
print ("Usage: %s -k {start|stop} [-r document_root] [--apache2]" %
sys.argv[0])
- sys.exit(0)
+ return 1
document_root = None
if options.root:
@@ -194,3 +195,6 @@ if '__main__' == __name__:
else:
StopServers(apache2=options.apache2)
+
+if '__main__' == __name__:
+ sys.exit(main())
« no previous file with comments | « tools/python/google/gethash_timer.py ('k') | tools/python/google/logging_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698