[pywin32-checkins] pywin32/Pythonwin/pywin/scintilla document.py, 1.11, 1.12
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2010-10-27 04:23:56
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9536/Pythonwin/pywin/scintilla Modified Files: document.py Log Message: offer to create a file which doesn't exist (ghazel via bug 1409321) Index: document.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/document.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** document.py 6 May 2010 16:30:20 -0000 1.11 --- document.py 27 Oct 2010 04:23:48 -0000 1.12 *************** *** 45,51 **** f.close() except IOError: ! win32ui.MessageBox("Could not load the file from %s" % filename) ! return 0 ! return 1 --- 45,61 ---- f.close() except IOError: ! rc = win32ui.MessageBox("Could not load the file from %s\n\nDo you want to create a new file?" % filename, ! "Pythonwin", win32con.MB_YESNO | win32con.MB_ICONWARNING) ! if rc == win32con.IDNO: ! return 0 ! assert rc == win32con.IDYES, rc ! try: ! f = open(filename, 'wb+') ! try: ! self._LoadTextFromFile(f) ! finally: ! f.close() ! except IOError, e: ! rc = win32ui.MessageBox("Cannot create the file %s" % filename) return 1 |