OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Utility functions for prompting user if changes automatically applied to some | 5 """Utility functions for prompting user if changes automatically applied to some |
6 user-managed files are correct. | 6 user-managed files are correct. |
7 """ | 7 """ |
8 | 8 |
9 import logging | 9 import logging |
10 import os | 10 import os |
(...skipping 27 matching lines...) Expand all Loading... |
38 try: | 38 try: |
39 temp.write(html_diff) | 39 temp.write(html_diff) |
40 temp.close() # Close the file so the browser process can access it. | 40 temp.close() # Close the file so the browser process can access it. |
41 webbrowser.open('file://' + temp.name) | 41 webbrowser.open('file://' + temp.name) |
42 print prompt | 42 print prompt |
43 response = raw_input('(Y/n): ').strip().lower() | 43 response = raw_input('(Y/n): ').strip().lower() |
44 finally: | 44 finally: |
45 temp.close() # May be called on already closed file. | 45 temp.close() # May be called on already closed file. |
46 os.remove(temp.name) | 46 os.remove(temp.name) |
47 return response == 'y' or response == '' | 47 return response == 'y' or response == '' |
OLD | NEW |