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

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: . 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
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..3494676f7b35c65d792744d4037701267eb4a788
--- a/tools/python/google/httpd_utils.py
+++ b/tools/python/google/httpd_utils.py
@@ -1,4 +1,4 @@
-#!/bin/env python
+#!/usr/bin/env python
# Copyright (c) 2006-2009 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())

Powered by Google App Engine
This is Rietveld 408576698