From aa539ba4c9dc3e99a4e55f21a10fb79b9402637c Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> Date: Wed, 23 Nov 2011 22:22:20 +0000 Subject: Fix many* python scripts in src/ Make sure that: - shebang is only present for executable files - shebang is #!/usr/bin/env python - __main__ is only present for executable files - file's executable bit is coherent Also fix EOF LF to be only one. * Do not fix them all at once otherwise the CL would be too large. TBR=jamiewalch@chromium.org BUG=105108 TEST= Review URL: http://codereview.chromium.org/8665013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111427 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome_frame/combine_libs.py | 6 ++++-- chrome_frame/tools/helper_shutdown.py | 12 ++++++++---- chrome_frame/tools/smoke_test.py | 8 +++++--- 3 files changed, 17 insertions(+), 9 deletions(-) mode change 100644 => 100755 chrome_frame/combine_libs.py mode change 100644 => 100755 chrome_frame/tools/helper_shutdown.py mode change 100644 => 100755 chrome_frame/tools/smoke_test.py (limited to 'chrome_frame') diff --git a/chrome_frame/combine_libs.py b/chrome_frame/combine_libs.py old mode 100644 new mode 100755 index 5a2efec..8f2380c --- a/chrome_frame/combine_libs.py +++ b/chrome_frame/combine_libs.py @@ -1,4 +1,5 @@ -# Copyright (c) 2010 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. @@ -108,7 +109,8 @@ def Main(): del os.environ['VS_UNICODE_OUTPUT'] CombineLibraries(output, remove_re, args) + return 0 if __name__ == '__main__': - Main() + sys.exit(Main()) diff --git a/chrome_frame/tools/helper_shutdown.py b/chrome_frame/tools/helper_shutdown.py old mode 100644 new mode 100755 index 770adda..a818808 --- a/chrome_frame/tools/helper_shutdown.py +++ b/chrome_frame/tools/helper_shutdown.py @@ -1,14 +1,18 @@ -# Copyright (c) 2010 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. -'''This is a simple helper script to shut down the Chrome Frame helper process. -It needs the Python Win32 extensions.''' +"""This is a simple helper script to shut down the Chrome Frame helper process. + +Requires Python Win32 extensions. +""" import pywintypes import sys import win32gui import win32con + def main(): exit_code = 0 window = win32gui.FindWindow('ChromeFrameHelperWindowClass', @@ -23,8 +27,8 @@ def main(): print 'Failed to shutdown Chrome Frame helper process: ' print ex exit_code = 1 - return exit_code + if __name__ == '__main__': sys.exit(main()) diff --git a/chrome_frame/tools/smoke_test.py b/chrome_frame/tools/smoke_test.py old mode 100644 new mode 100755 index f28d0a6..bc8959e --- a/chrome_frame/tools/smoke_test.py +++ b/chrome_frame/tools/smoke_test.py @@ -1,9 +1,11 @@ -# Copyright (c) 2010 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. -'''This script builds and runs the Chrome Frame unit and integration tests, +"""Builds and runs the Chrome Frame unit and integration tests, the exit status of the scrip is the number of failed tests. -''' +""" + import os.path import sys import win32com.client -- cgit v1.1