Update of /cvsroot/pywin32/pywin32/com/win32comext/axdebug
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/com/win32comext/axdebug
Modified Files:
Tag: py3k
adb.py codecontainer.py debugger.py documents.py dump.py
expressions.py gateways.py stackframe.py util.py
Log Message:
many more upgrades to py3k syntax
Index: expressions.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/expressions.py,v
retrieving revision 1.5
retrieving revision 1.5.4.1
diff -C2 -d -r1.5 -r1.5.4.1
*** expressions.py 18 Jun 2006 13:18:26 -0000 1.5
--- expressions.py 26 Nov 2008 09:03:29 -0000 1.5.4.1
***************
*** 43,47 ****
self.result = eval(self.code, self.frame.f_globals, self.frame.f_locals)
except SyntaxError:
! exec self.code in self.frame.f_globals, self.frame.f_locals
self.result = ""
self.hresult = 0
--- 43,47 ----
self.result = eval(self.code, self.frame.f_globals, self.frame.f_locals)
except SyntaxError:
! exec(self.code, self.frame.f_globals, self.frame.f_locals)
self.result = ""
self.hresult = 0
***************
*** 55,59 ****
callback.onComplete()
def Abort(self):
! print "** ABORT **"
def QueryIsComplete(self):
--- 55,59 ----
callback.onComplete()
def Abort(self):
! print("** ABORT **")
def QueryIsComplete(self):
Index: gateways.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/gateways.py,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -C2 -d -r1.3 -r1.3.4.1
*** gateways.py 18 Jun 2006 13:18:26 -0000 1.3
--- gateways.py 26 Nov 2008 09:03:29 -0000 1.3.4.1
***************
*** 168,172 ****
Return value must be PyIDebugDocumentContext object
"""
! print self
RaiseNotImpl("GetContextOfPosition")
--- 168,172 ----
Return value must be PyIDebugDocumentContext object
"""
! print(self)
RaiseNotImpl("GetContextOfPosition")
Index: dump.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/dump.py,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -C2 -d -r1.2 -r1.2.4.1
*** dump.py 18 Jun 2006 13:18:26 -0000 1.2
--- dump.py 26 Nov 2008 09:03:29 -0000 1.2.4.1
***************
*** 17,21 ****
except pythoncom.com_error:
info = "<N/A>"
! print "%s%s: %s" % (spacer, desc, info)
try:
doc = node.GetDocument()
--- 17,21 ----
except pythoncom.com_error:
info = "<N/A>"
! print("%s%s: %s" % (spacer, desc, info))
try:
doc = node.GetDocument()
***************
*** 27,33 ****
# text, attr = doctext.GetText(0, 20, 1)
text, attr = doctext.GetText(0, numChars, 1)
! print "%sText is %s, %d bytes long" % (spacer, repr(text[:40]+"..."), len(text))
else:
! print "%s%s" % (spacer, "<No document available>")
for child in Enumerator(node.EnumChildren()):
--- 27,33 ----
# text, attr = doctext.GetText(0, 20, 1)
text, attr = doctext.GetText(0, numChars, 1)
! print("%sText is %s, %d bytes long" % (spacer, repr(text[:40]+"..."), len(text)))
else:
! print("%s%s" % (spacer, "<No document available>"))
for child in Enumerator(node.EnumChildren()):
***************
*** 38,42 ****
e=Enumerator(dm.EnumApplications())
for app in e:
! print "Application: %s" % app.GetName()
node = app.GetRootNode() # of type PyIDebugApplicationNode->PyIDebugDocumentProvider->PyIDebugDocumentInfo
DumpDebugApplicationNode(node)
--- 38,42 ----
e=Enumerator(dm.EnumApplications())
for app in e:
! print("Application: %s" % app.GetName())
node = app.GetRootNode() # of type PyIDebugApplicationNode->PyIDebugDocumentProvider->PyIDebugDocumentInfo
DumpDebugApplicationNode(node)
Index: adb.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/adb.py,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -d -r1.6 -r1.6.2.1
*** adb.py 8 Apr 2008 11:14:00 -0000 1.6
--- adb.py 26 Nov 2008 09:03:29 -0000 1.6.2.1
***************
*** 116,120 ****
self.breakReason = axdebug.BREAKREASON_STEP
else:
! print "Calling base 'break_here' with", self.breaks
if bdb.Bdb.break_here(self, frame):
self.breakReason = axdebug.BREAKREASON_BREAKPOINT
--- 116,120 ----
self.breakReason = axdebug.BREAKREASON_STEP
else:
! print("Calling base 'break_here' with", self.breaks)
if bdb.Bdb.break_here(self, frame):
self.breakReason = axdebug.BREAKREASON_BREAKPOINT
***************
*** 204,210 ****
bdb.Bdb.user_return(self, frame, return_value)
! def user_exception(self, frame, (exc_type, exc_value, exc_traceback)):
# traceenter("user_exception")
! bdb.Bdb.user_exception(self, frame, (exc_type, exc_value, exc_traceback))
--- 204,210 ----
bdb.Bdb.user_return(self, frame, return_value)
! def user_exception(self, frame, exc_info):
# traceenter("user_exception")
! bdb.Bdb.user_exception(self, frame, exc_info)
***************
*** 215,219 ****
resumeAction = self.debugApplication.HandleBreakPoint(reason)
tracev("HandleBreakPoint returned with ", resumeAction)
! except pythoncom.com_error, details:
# Eeek - the debugger is dead, or something serious is happening.
# Assume we should continue
--- 215,219 ----
resumeAction = self.debugApplication.HandleBreakPoint(reason)
tracev("HandleBreakPoint returned with ", resumeAction)
! except pythoncom.com_error as details:
# Eeek - the debugger is dead, or something serious is happening.
# Assume we should continue
***************
*** 403,407 ****
problem = self.set_break(key, lineNo)
if problem:
! print "*** set_break failed -", problem
trace("_OnSetBreakPoint just set BP and has breaks", self.breaks)
else:
--- 403,407 ----
problem = self.set_break(key, lineNo)
if problem:
! print("*** set_break failed -", problem)
trace("_OnSetBreakPoint just set BP and has breaks", self.breaks)
else:
Index: util.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/util.py,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -C2 -d -r1.3 -r1.3.4.1
*** util.py 18 Jun 2006 13:18:26 -0000 1.3
--- util.py 26 Nov 2008 09:03:29 -0000 1.3.4.1
***************
*** 17,24 ****
def trace(*args):
if not debugging: return
! print str(win32api.GetCurrentThreadId()) + ":",
for arg in args:
! print arg,
! print
# The AXDebugging implementation assumes that the returned COM pointers are in
--- 17,24 ----
def trace(*args):
if not debugging: return
! print(str(win32api.GetCurrentThreadId()) + ":", end=' ')
for arg in args:
! print(arg, end=' ')
! print()
# The AXDebugging implementation assumes that the returned COM pointers are in
***************
*** 52,68 ****
def _dump_wrapped():
from win32com.server.util import unwrap
! print "Wrapped items:"
for key, items in all_wrapped.items():
! print key,
try:
ob = unwrap(key)
! print ob, sys.getrefcount(ob)
except:
! print "<error>"
def RaiseNotImpl(who = None):
if who is not None:
! print "********* Function %s Raising E_NOTIMPL ************" % (who)
# Print a sort-of "traceback", dumping all the frames leading to here.
--- 52,68 ----
def _dump_wrapped():
from win32com.server.util import unwrap
! print("Wrapped items:")
for key, items in all_wrapped.items():
! print(key, end=' ')
try:
ob = unwrap(key)
! print(ob, sys.getrefcount(ob))
except:
! print("<error>")
def RaiseNotImpl(who = None):
if who is not None:
! print("********* Function %s Raising E_NOTIMPL ************" % (who))
# Print a sort-of "traceback", dumping all the frames leading to here.
***************
*** 72,76 ****
frame = sys.exc_info()[2].tb_frame
while frame:
! print "File: %s, Line: %d" % (frame.f_code.co_filename, frame.f_lineno)
frame = frame.f_back
--- 72,76 ----
frame = sys.exc_info()[2].tb_frame
while frame:
! print("File: %s, Line: %d" % (frame.f_code.co_filename, frame.f_lineno))
frame = frame.f_back
***************
*** 93,97 ****
def _Invoke_(self, dispid, lcid, wFlags, args):
! print "In Invoke with", dispid, lcid, wFlags, args, "with object",self.policy._obj_
try:
rc = win32com.server.policy.DispatcherBase._Invoke_(self, dispid, lcid, wFlags, args)
--- 93,97 ----
def _Invoke_(self, dispid, lcid, wFlags, args):
! print("In Invoke with", dispid, lcid, wFlags, args, "with object",self.policy._obj_)
try:
rc = win32com.server.policy.DispatcherBase._Invoke_(self, dispid, lcid, wFlags, args)
***************
*** 106,114 ****
except AttributeError:
desc = ""
! print "*** Invoke of %s raised COM exception 0x%x%s" % (dispid, scode, desc)
except:
! print "*** Invoke of %s failed:" % dispid
typ, val, tb = sys.exc_info()
import traceback
traceback.print_exception(typ, val, tb)
! raise typ, val, tb
--- 106,114 ----
except AttributeError:
desc = ""
! print("*** Invoke of %s raised COM exception 0x%x%s" % (dispid, scode, desc))
except:
! print("*** Invoke of %s failed:" % dispid)
typ, val, tb = sys.exc_info()
import traceback
traceback.print_exception(typ, val, tb)
! raise
Index: debugger.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/debugger.py,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -C2 -d -r1.3 -r1.3.4.1
*** debugger.py 21 Jun 2006 12:14:42 -0000 1.3
--- debugger.py 26 Nov 2008 09:03:29 -0000 1.3.4.1
***************
*** 83,87 ****
documents.CodeContainerProvider.Close(self)
self.axdebugger = None
! print "Closing %d nodes" % (len(self.nodes))
for node in self.nodes.values():
node.Close()
--- 83,87 ----
documents.CodeContainerProvider.Close(self)
self.axdebugger = None
! print("Closing %d nodes" % (len(self.nodes)))
for node in self.nodes.values():
node.Close()
***************
*** 196,203 ****
raw_input("Waiting...")
dosomething()
! print "Done"
if __name__=='__main__':
! print "About to test the debugging interfaces!"
test()
! print " %d/%d com objects still alive" % (pythoncom._GetInterfaceCount(), pythoncom._GetGatewayCount())
--- 196,203 ----
raw_input("Waiting...")
dosomething()
! print("Done")
if __name__=='__main__':
! print("About to test the debugging interfaces!")
test()
! print(" %d/%d com objects still alive" % (pythoncom._GetInterfaceCount(), pythoncom._GetGatewayCount()))
Index: documents.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/documents.py,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -C2 -d -r1.2 -r1.2.4.1
*** documents.py 18 Jun 2006 13:18:26 -0000 1.2
--- documents.py 26 Nov 2008 09:03:29 -0000 1.2.4.1
***************
*** 15,19 ****
def GetGoodFileName(fname):
! if fname[0] <> "<":
return win32api.GetFullPathName(fname)
return fname
--- 15,19 ----
def GetGoodFileName(fname):
! if fname[0] != "<":
return win32api.GetFullPathName(fname)
return fname
Index: stackframe.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/stackframe.py,v
retrieving revision 1.4
retrieving revision 1.4.4.1
diff -C2 -d -r1.4 -r1.4.4.1
*** stackframe.py 18 Jun 2006 13:18:26 -0000 1.4
--- stackframe.py 26 Nov 2008 09:03:29 -0000 1.4.4.1
***************
*** 139,143 ****
def EnumMembers(self, dwFieldSpec, nRadix, iid):
! print "EnumMembers", dwFieldSpec, nRadix, iid
import expressions
return expressions.MakeEnumDebugProperty(self.frame.f_locals, dwFieldSpec, nRadix, iid, self.frame)
--- 139,143 ----
def EnumMembers(self, dwFieldSpec, nRadix, iid):
! print("EnumMembers", dwFieldSpec, nRadix, iid)
import expressions
return expressions.MakeEnumDebugProperty(self.frame.f_locals, dwFieldSpec, nRadix, iid, self.frame)
Index: codecontainer.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/codecontainer.py,v
retrieving revision 1.4
retrieving revision 1.4.4.1
diff -C2 -d -r1.4 -r1.4.4.1
*** codecontainer.py 18 Jun 2006 13:18:26 -0000 1.4
--- codecontainer.py 26 Nov 2008 09:03:29 -0000 1.4.4.1
***************
*** 106,110 ****
line, pos = self._buildline(pos)
! def _ProcessToken(self, type, token, (srow, scol), (erow, ecol), line):
self.GetText() # Prime us.
linenum = srow - 1 # Lines zero based for us too.
--- 106,112 ----
line, pos = self._buildline(pos)
! def _ProcessToken(self, type, token, spos, epos, line):
! srow, scol = spos
! erow, ecol = epos
self.GetText() # Prime us.
linenum = srow - 1 # Lines zero based for us too.
***************
*** 203,207 ****
try:
self.text = open(fname, "r").read()
! except IOError, details:
self.text = "# Exception opening file\n# %s" % (`details`)
else:
--- 205,209 ----
try:
self.text = open(fname, "r").read()
! except IOError as details:
self.text = "# Exception opening file\n# %s" % (`details`)
else:
***************
*** 244,252 ****
text = sc.GetText()
if attrlen!=len(text):
! print "Lengths dont match!!! (%d/%d)" % (attrlen, len(text))
# print "Attributes:"
# print attrs
! print "GetLineOfPos=", sc.GetLineOfPosition(0)
! print "GetLineOfPos=", sc.GetLineOfPosition(4)
! print "GetLineOfPos=", sc.GetLineOfPosition(10)
--- 246,254 ----
text = sc.GetText()
if attrlen!=len(text):
! print("Lengths dont match!!! (%d/%d)" % (attrlen, len(text)))
# print "Attributes:"
# print attrs
! print("GetLineOfPos=", sc.GetLineOfPosition(0))
! print("GetLineOfPos=", sc.GetLineOfPosition(4))
! print("GetLineOfPos=", sc.GetLineOfPosition(10))
|