Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18484
Modified Files:
Tag: py3k
ModuleBrowser.py __init__.py configui.py document.py editor.py
frame.py template.py vss.py
Log Message:
Changes for Python 3
Index: ModuleBrowser.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/ModuleBrowser.py,v
retrieving revision 1.8
retrieving revision 1.8.4.1
diff -C2 -d -r1.8 -r1.8.4.1
*** ModuleBrowser.py 3 Nov 2003 07:34:24 -0000 1.8
--- ModuleBrowser.py 29 Aug 2008 06:17:09 -0000 1.8.4.1
***************
*** 19,28 ****
def GetSubList(self):
ret = []
! for item in self.clbrdata.values():
if item.__class__ != pyclbr.Class: # ie, it is a pyclbr Function instance (only introduced post 1.5.2)
ret.append(HierListCLBRFunction( item ) )
else:
ret.append(HierListCLBRClass( item) )
! ret.sort()
return ret
def IsExpandable(self):
--- 19,28 ----
def GetSubList(self):
ret = []
! for item in list(self.clbrdata.values()):
if item.__class__ != pyclbr.Class: # ie, it is a pyclbr Function instance (only introduced post 1.5.2)
ret.append(HierListCLBRFunction( item ) )
else:
ret.append(HierListCLBRClass( item) )
! ## ret.sort() - Py3k will not compare objects of different types
return ret
def IsExpandable(self):
***************
*** 77,81 ****
r1.sort()
r2=[]
! for meth, lineno in self.methods.items():
r2.append(HierListCLBRMethod(meth, self.file, lineno))
r2.sort()
--- 77,81 ----
r1.sort()
r2=[]
! for meth, lineno in list(self.methods.items()):
r2.append(HierListCLBRMethod(meth, self.file, lineno))
r2.sort()
Index: document.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/document.py,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -C2 -d -r1.11 -r1.11.2.1
*** document.py 9 Aug 2008 16:47:20 -0000 1.11
--- document.py 29 Aug 2008 06:17:09 -0000 1.11.2.1
***************
*** 77,81 ****
try:
self.SaveFile(fileName)
! except IOError, details:
win32ui.MessageBox("Error - could not save file\r\n\r\n%s"%details)
return 0
--- 77,81 ----
try:
self.SaveFile(fileName)
! except IOError as details:
win32ui.MessageBox("Error - could not save file\r\n\r\n%s"%details)
return 0
***************
*** 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,139 ****
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
if self.bReportedFileNotFound:
! print "The file '%s' has re-appeared - continuing to watch for changes..." % (self.GetPathName(),)
self.bReportedFileNotFound = 0 # Once found again we want to start complaining.
changed = (self.fileStat is None) or \
--- 129,140 ----
try:
newstat = os.stat(self.GetPathName())
! except os.error as xxx_todo_changeme:
! (code, msg) = xxx_todo_changeme.args
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
if self.bReportedFileNotFound:
! print("The file '%s' has re-appeared - continuing to watch for changes..." % (self.GetPathName(),))
self.bReportedFileNotFound = 0 # Once found again we want to start complaining.
changed = (self.fileStat is None) or \
***************
*** 219,223 ****
if pretend_ss:
! print "We are only pretending to check it out!"
win32api.SetFileAttributes(self.GetPathName(), win32con.FILE_ATTRIBUTE_NORMAL)
self.ReloadDocument()
--- 220,224 ----
if pretend_ss:
! print("We are only pretending to check it out!")
win32api.SetFileAttributes(self.GetPathName(), win32con.FILE_ATTRIBUTE_NORMAL)
self.ReloadDocument()
***************
*** 232,236 ****
except:
traceback.print_exc()
! print "Error loading source control module."
return 0
--- 233,237 ----
except:
traceback.print_exc()
! print("Error loading source control module.")
return 0
***************
*** 254,258 ****
frame.AutoRestore()
except:
! print "Could not bring document to foreground"
return self._obj_.SaveModified()
--- 255,259 ----
frame.AutoRestore()
except:
! print("Could not bring document to foreground")
return self._obj_.SaveModified()
***************
*** 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)
--- 289,295 ----
try:
self.watchEvent = win32api.FindFirstChangeNotification(path, 0, filter)
! except win32api.error as xxx_todo_changeme1:
! (rc, fn, msg) = xxx_todo_changeme1.args
! print("Can not watch file", path, "for changes -", msg)
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
--- 309,315 ----
# If the directory has been removed underneath us, we get this error.
win32api.FindNextChangeNotification(self.watchEvent)
! except win32api.error as xxx_todo_changeme2:
! (rc, fn, msg) = xxx_todo_changeme2.args
! print("Can not watch file", self.doc.GetPathName(), "for changes -", msg)
break
Index: __init__.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/__init__.py,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -C2 -d -r1.2 -r1.2.4.1
*** __init__.py 11 Mar 2000 00:52:46 -0000 1.2
--- __init__.py 29 Aug 2008 06:17:09 -0000 1.2.4.1
***************
*** 82,86 ****
return eval(fmt)
except:
! print "WARNING: Invalid font setting in registry - setting ignored"
return default
--- 82,86 ----
return eval(fmt)
except:
! print("WARNING: Invalid font setting in registry - setting ignored")
return default
Index: editor.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/editor.py,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -C2 -d -r1.4 -r1.4.2.1
*** editor.py 9 Aug 2008 16:47:20 -0000 1.4
--- editor.py 29 Aug 2008 06:17:09 -0000 1.4.2.1
***************
*** 59,63 ****
#ParentEditorDocument=docview.Document
! from document import EditorDocumentBase
ParentEditorDocument=EditorDocumentBase
class EditorDocument(ParentEditorDocument):
--- 59,63 ----
#ParentEditorDocument=docview.Document
! from .document import EditorDocumentBase
ParentEditorDocument=EditorDocumentBase
class EditorDocument(ParentEditorDocument):
***************
*** 304,308 ****
try:
if lineNo is None:
! lineNo = int(raw_input("Enter Line Number"))
except (ValueError, KeyboardInterrupt):
return 0
--- 304,308 ----
try:
if lineNo is None:
! lineNo = int(input("Enter Line Number"))
except (ValueError, KeyboardInterrupt):
return 0
***************
*** 436,440 ****
self.bCheckingFile = 0
! from template import EditorTemplateBase
class EditorTemplate(EditorTemplateBase):
def __init__(self, res=win32ui.IDR_TEXTTYPE, makeDoc=None, makeFrame=None, makeView=None):
--- 436,440 ----
self.bCheckingFile = 0
! from .template import EditorTemplateBase
class EditorTemplate(EditorTemplateBase):
def __init__(self, res=win32ui.IDR_TEXTTYPE, makeDoc=None, makeFrame=None, makeView=None):
Index: vss.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/vss.py,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -C2 -d -r1.4 -r1.4.2.1
*** vss.py 9 Aug 2008 16:47:20 -0000 1.4
--- vss.py 29 Aug 2008 06:17:09 -0000 1.4.2.1
***************
*** 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 as xxx_todo_changeme:
! (hr, msg, exc, arg) = xxx_todo_changeme.args
if exc:
msg = exc[2]
Index: configui.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/configui.py,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -C2 -d -r1.8 -r1.8.2.1
*** configui.py 25 Feb 2008 05:31:46 -0000 1.8
--- configui.py 29 Aug 2008 06:17:09 -0000 1.8.2.1
***************
*** 1,4 ****
from pywin.mfc import dialog
! import document
import win32ui
import win32con
--- 1,4 ----
from pywin.mfc import dialog
! from . import document
import win32ui
import win32con
***************
*** 47,51 ****
-
def _AddEditorOption(self, idd, typ, optionName, defaultVal):
self.AddDDX(idd, optionName, typ)
--- 47,50 ----
Index: template.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/template.py,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -C2 -d -r1.4 -r1.4.2.1
*** template.py 9 Aug 2008 16:47:20 -0000 1.4
--- template.py 29 Aug 2008 06:17:09 -0000 1.4.2.1
***************
*** 5,9 ****
import pywin.framework.window
import os
! import frame
ParentEditorTemplate=docview.DocTemplate
--- 5,9 ----
import pywin.framework.window
import os
! from . import frame
ParentEditorTemplate=docview.DocTemplate
***************
*** 34,38 ****
"""Returns a list of property pages
"""
! import configui
return [configui.EditorPropertyPage(), configui.EditorWhitespacePropertyPage()]
--- 34,38 ----
"""Returns a list of property pages
"""
! from . import configui
return [configui.EditorPropertyPage(), configui.EditorWhitespacePropertyPage()]
***************
*** 45,49 ****
filename = os.path.join(path, filename)
# print `filename`
! except (win32api.error, IndexError), details:
pass
# print "Couldnt get the full filename!", details
--- 45,49 ----
filename = os.path.join(path, filename)
# print `filename`
! except (win32api.error, IndexError) as details:
pass
# print "Couldnt get the full filename!", details
Index: frame.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/frame.py,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -d -r1.6 -r1.6.2.1
*** frame.py 25 Feb 2008 03:19:12 -0000 1.6
--- frame.py 29 Aug 2008 06:17:09 -0000 1.6.2.1
***************
*** 4,9 ****
import win32con
import afxres
!
! import ModuleBrowser
class EditorFrame(pywin.framework.window.MDIChildWnd):
--- 4,8 ----
import win32con
import afxres
! from . import ModuleBrowser
class EditorFrame(pywin.framework.window.MDIChildWnd):
|