Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18401/Pythonwin/pywin/framework/editor
Modified Files:
document.py vss.py
Log Message:
More py3k compatible syntax modernizations merged from py3k branch.
Index: vss.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/vss.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** vss.py 9 Aug 2008 16:47:20 -0000 1.4
--- vss.py 2 Oct 2008 13:03:55 -0000 1.5
***************
*** 82,86 ****
item.Checkout(None, fileName)
ok = 1
! except pythoncom.com_error, (hr, msg, exc, arg):
if exc:
msg = exc[2]
--- 82,87 ----
item.Checkout(None, fileName)
ok = 1
! except pythoncom.com_error, exc:
! msg = exc.strerror
if exc:
msg = exc[2]
Index: document.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/document.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** document.py 9 Aug 2008 16:47:20 -0000 1.11
--- document.py 2 Oct 2008 13:03:55 -0000 1.12
***************
*** 117,121 ****
states.append(info)
self.OnOpenDocument(self.GetPathName())
! for view, info in map(None, views, states):
if info is not None:
view._EndUserStateChange(info)
--- 117,121 ----
states.append(info)
self.OnOpenDocument(self.GetPathName())
! for view, info in zip(views, states):
if info is not None:
view._EndUserStateChange(info)
***************
*** 129,135 ****
try:
newstat = os.stat(self.GetPathName())
! except os.error, (code, msg):
if not self.bReportedFileNotFound:
! print "The file '%s' is open for editing, but\nchecking it for changes caused the error: %s" % (self.GetPathName(), msg)
self.bReportedFileNotFound = 1
return
--- 129,135 ----
try:
newstat = os.stat(self.GetPathName())
! except os.error, exc:
if not self.bReportedFileNotFound:
! print "The file '%s' is open for editing, but\nchecking it for changes caused the error: %s" % (self.GetPathName(), exc.strerror)
self.bReportedFileNotFound = 1
return
***************
*** 288,293 ****
try:
self.watchEvent = win32api.FindFirstChangeNotification(path, 0, filter)
! except win32api.error, (rc, fn, msg):
! print "Can not watch file", path, "for changes -", msg
def SignalStop(self):
win32event.SetEvent(self.stopEvent)
--- 288,293 ----
try:
self.watchEvent = win32api.FindFirstChangeNotification(path, 0, filter)
! except win32api.error, exc:
! print "Can not watch file", path, "for changes -", exc.strerror
def SignalStop(self):
win32event.SetEvent(self.stopEvent)
***************
*** 307,312 ****
# If the directory has been removed underneath us, we get this error.
win32api.FindNextChangeNotification(self.watchEvent)
! except win32api.error, (rc, fn, msg):
! print "Can not watch file", self.doc.GetPathName(), "for changes -", msg
break
--- 307,312 ----
# If the directory has been removed underneath us, we get this error.
win32api.FindNextChangeNotification(self.watchEvent)
! except win32api.error, exc:
! print "Can not watch file", self.doc.GetPathName(), "for changes -", exc.strerror
break
|