OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
6 # | 6 # |
7 | 7 |
8 # A script to kill hanging processs. The tool will return non-zero if any | 8 # A script to kill hanging processs. The tool will return non-zero if any |
9 # process was actually found. | 9 # process was actually found. |
10 # | 10 # |
(...skipping 28 matching lines...) Expand all Loading... |
39 'content_shell': 'content_shell', | 39 'content_shell': 'content_shell', |
40 'dart': 'dart', | 40 'dart': 'dart', |
41 'firefox': 'firefox.exe', | 41 'firefox': 'firefox.exe', |
42 'git': 'git', | 42 'git': 'git', |
43 'svn': 'svn', | 43 'svn': 'svn', |
44 'fletch': 'fletch', | 44 'fletch': 'fletch', |
45 'fletch-vm': 'fletch-vm', | 45 'fletch-vm': 'fletch-vm', |
46 }, | 46 }, |
47 'macos': { | 47 'macos': { |
48 'chrome': 'Chrome', | 48 'chrome': 'Chrome', |
| 49 'chrome_helper': 'Chrome Helper', |
49 'content_shell': 'Content Shell', | 50 'content_shell': 'Content Shell', |
50 'dart': 'dart', | 51 'dart': 'dart', |
51 'firefox': 'firefox', | 52 'firefox': 'firefox', |
52 'safari': 'Safari', | 53 'safari': 'Safari', |
53 'git': 'git', | 54 'git': 'git', |
54 'svn': 'svn', | 55 'svn': 'svn', |
55 'fletch': 'fletch', | 56 'fletch': 'fletch', |
56 'fletch-vm': 'fletch-vm', | 57 'fletch-vm': 'fletch-vm', |
57 } | 58 } |
58 } | 59 } |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 print("Killed pid: %s" % pid) | 204 print("Killed pid: %s" % pid) |
204 if len(pids) == 0: | 205 if len(pids) == 0: |
205 print(" No %s processes found." % name) | 206 print(" No %s processes found." % name) |
206 return len(pids) | 207 return len(pids) |
207 | 208 |
208 def KillBrowsers(): | 209 def KillBrowsers(): |
209 status = Kill('firefox') | 210 status = Kill('firefox') |
210 # We don't give error on killing chrome. It happens quite often that the | 211 # We don't give error on killing chrome. It happens quite often that the |
211 # browser controller fails in killing chrome, so we silently do it here. | 212 # browser controller fails in killing chrome, so we silently do it here. |
212 Kill('chrome') | 213 Kill('chrome') |
| 214 status += Kill('chrome_helper') |
213 status += Kill('iexplore') | 215 status += Kill('iexplore') |
214 status += Kill('safari') | 216 status += Kill('safari') |
215 status += Kill('content_shell') | 217 status += Kill('content_shell') |
216 return status | 218 return status |
217 | 219 |
218 def KillVCSystems(): | 220 def KillVCSystems(): |
219 status = Kill('git') | 221 status = Kill('git') |
220 status += Kill('svn') | 222 status += Kill('svn') |
221 return status | 223 return status |
222 | 224 |
(...skipping 18 matching lines...) Expand all Loading... |
241 if options.kill_fletch: | 243 if options.kill_fletch: |
242 status += KillFletch() | 244 status += KillFletch() |
243 if options.kill_vc: | 245 if options.kill_vc: |
244 status += KillVCSystems() | 246 status += KillVCSystems() |
245 if options.kill_browsers: | 247 if options.kill_browsers: |
246 status += KillBrowsers() | 248 status += KillBrowsers() |
247 return status | 249 return status |
248 | 250 |
249 if __name__ == '__main__': | 251 if __name__ == '__main__': |
250 sys.exit(Main()) | 252 sys.exit(Main()) |
OLD | NEW |