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

Side by Side Diff: chrome_frame/tools/helper_shutdown.py

Issue 8665013: Fix many* python scripts in src/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed chrome_frame/tools/test/page_cycler/cf_cycler.py 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome_frame/combine_libs.py ('k') | chrome_frame/tools/smoke_test.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 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 # 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
3 # found in the LICENSE file. 4 # found in the LICENSE file.
4 '''This is a simple helper script to shut down the Chrome Frame helper process. 5 """This is a simple helper script to shut down the Chrome Frame helper process.
5 It needs the Python Win32 extensions.''' 6
7 Requires Python Win32 extensions.
8 """
6 9
7 import pywintypes 10 import pywintypes
8 import sys 11 import sys
9 import win32gui 12 import win32gui
10 import win32con 13 import win32con
11 14
15
12 def main(): 16 def main():
13 exit_code = 0 17 exit_code = 0
14 window = win32gui.FindWindow('ChromeFrameHelperWindowClass', 18 window = win32gui.FindWindow('ChromeFrameHelperWindowClass',
15 'ChromeFrameHelperWindowName') 19 'ChromeFrameHelperWindowName')
16 if not window: 20 if not window:
17 print 'Chrome Frame helper process not running.' 21 print 'Chrome Frame helper process not running.'
18 else: 22 else:
19 try: 23 try:
20 win32gui.PostMessage(window, win32con.WM_CLOSE, 0, 0) 24 win32gui.PostMessage(window, win32con.WM_CLOSE, 0, 0)
21 print 'Chrome Frame helper process shut down.' 25 print 'Chrome Frame helper process shut down.'
22 except pywintypes.error as ex: 26 except pywintypes.error as ex:
23 print 'Failed to shutdown Chrome Frame helper process: ' 27 print 'Failed to shutdown Chrome Frame helper process: '
24 print ex 28 print ex
25 exit_code = 1 29 exit_code = 1
30 return exit_code
26 31
27 return exit_code
28 32
29 if __name__ == '__main__': 33 if __name__ == '__main__':
30 sys.exit(main()) 34 sys.exit(main())
OLDNEW
« no previous file with comments | « chrome_frame/combine_libs.py ('k') | chrome_frame/tools/smoke_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698