Update of /cvsroot/pywin32/pywin32/com/win32comext/axscript/test
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/com/win32comext/axscript/test
Modified Files:
Tag: py3k
leakTest.py testHost.py testHost4Dbg.py
Log Message:
many more upgrades to py3k syntax
Index: testHost4Dbg.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/test/testHost4Dbg.py,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -C2 -d -r1.1 -r1.1.4.1
*** testHost4Dbg.py 1 Sep 1999 23:12:51 -0000 1.1
--- testHost4Dbg.py 26 Nov 2008 09:03:30 -0000 1.1.4.1
***************
*** 12,16 ****
def OnScriptError(self, error):
! print "An error occurred in the Script Code"
exc = error.GetExceptionInfo()
try:
--- 12,16 ----
def OnScriptError(self, error):
! print("An error occurred in the Script Code")
exc = error.GetExceptionInfo()
try:
***************
*** 19,28 ****
text = "<unknown>"
context, line, char = error.GetSourcePosition()
! print "Exception: %s (line %d)\n%s\n%s^\n%s" % (exc[1], line, text, " " * (char-1), exc[2])
class ObjectModel:
_public_methods_ = [ 'echo', 'msgbox' ]
def echo(self, *args):
! print string.join(map(str, args))
def msgbox(self, *args):
msg = string.join(map(str, args))
--- 19,28 ----
text = "<unknown>"
context, line, char = error.GetSourcePosition()
! print("Exception: %s (line %d)\n%s\n%s^\n%s" % (exc[1], line, text, " " * (char-1), exc[2]))
class ObjectModel:
_public_methods_ = [ 'echo', 'msgbox' ]
def echo(self, *args):
! print(string.join(map(str, args)))
def msgbox(self, *args):
msg = string.join(map(str, args))
***************
*** 55,60 ****
pyEngine.Start() # Actually run the Python code
vbEngine.Start() # Actually run the VB code
! except pythoncom.com_error, details:
! print "Script failed: %s (0x%x)" % (details[1], details[0])
# Now run the code expected to fail!
# try:
--- 55,60 ----
pyEngine.Start() # Actually run the Python code
vbEngine.Start() # Actually run the VB code
! except pythoncom.com_error as details:
! print("Script failed: %s (0x%x)" % (details[1], details[0]))
# Now run the code expected to fail!
# try:
***************
*** 74,76 ****
win32com.axdebug.util._dump_wrapped()
sys.exc_type = sys.exc_value = sys.exc_traceback = None
! print pythoncom._GetInterfaceCount(),"com objects still alive"
--- 74,76 ----
win32com.axdebug.util._dump_wrapped()
sys.exc_type = sys.exc_value = sys.exc_traceback = None
! print(pythoncom._GetInterfaceCount(),"com objects still alive")
Index: testHost.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/test/testHost.py,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -C2 -d -r1.5.2.1 -r1.5.2.2
*** testHost.py 26 Nov 2008 07:17:39 -0000 1.5.2.1
--- testHost.py 26 Nov 2008 09:03:30 -0000 1.5.2.2
***************
*** 24,28 ****
if not verbose:
return
! print " >Exception:", exc[1]
try:
st = error.GetSourceLineText()
--- 24,28 ----
if not verbose:
return
! print(" >Exception:", exc[1])
try:
st = error.GetSourceLineText()
***************
*** 32,36 ****
text = st + "\n" + (" " * (char-1)) + "^" + "\n" + exc[2]
for line in text.splitlines():
! print " >" + line
class MyCollection(util.Collection):
--- 32,36 ----
text = st + "\n" + (" " * (char-1)) + "^" + "\n" + exc[2]
for line in text.splitlines():
! print(" >" + line)
class MyCollection(util.Collection):
***************
*** 52,63 ****
if self.verbose:
for arg in args:
! print arg,
! print
def fail(self, *args):
! print "**** fail() called ***"
for arg in args:
! print arg,
! print
self.fail_called = 1
# self._connect_server_.Broadcast(last)
--- 52,63 ----
if self.verbose:
for arg in args:
! print(arg, end=' ')
! print()
def fail(self, *args):
! print("**** fail() called ***")
for arg in args:
! print(arg, end=' ')
! print()
self.fail_called = 1
# self._connect_server_.Broadcast(last)
Index: leakTest.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/test/leakTest.py,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -C2 -d -r1.1 -r1.1.4.1
*** leakTest.py 18 Dec 2002 11:57:23 -0000 1.1
--- leakTest.py 26 Nov 2008 09:03:30 -0000 1.1.4.1
***************
*** 12,16 ****
exc = error.GetExceptionInfo()
context, line, char = error.GetSourcePosition()
! print " >Exception:", exc[1]
try:
st = error.GetSourceLineText()
--- 12,16 ----
exc = error.GetExceptionInfo()
context, line, char = error.GetSourcePosition()
! print(" >Exception:", exc[1])
try:
st = error.GetSourceLineText()
***************
*** 20,28 ****
text = st + "\n" + (" " * (char-1)) + "^" + "\n" + exc[2]
for line in string.split(text,"\n"):
! print " >" + line
class MyCollection(util.Collection):
def _NewEnum(self):
! print "Making new Enumerator"
return util.Collection._NewEnum(self)
--- 20,28 ----
text = st + "\n" + (" " * (char-1)) + "^" + "\n" + exc[2]
for line in string.split(text,"\n"):
! print(" >" + line)
class MyCollection(util.Collection):
def _NewEnum(self):
! print("Making new Enumerator")
return util.Collection._NewEnum(self)
***************
*** 40,45 ****
if self.verbose:
for arg in args:
! print arg,
! print
# self._connect_server_.Broadcast(last)
--- 40,45 ----
if self.verbose:
for arg in args:
! print(arg, end=' ')
! print()
# self._connect_server_.Broadcast(last)
***************
*** 117,121 ****
engine.eScript.SetScriptState(axscript.SCRIPTSTATE_UNINITIALIZED)
engine.eScript.SetScriptSite(util.wrap(site))
! print "restarting"
engine.Start()
# all done!
--- 117,121 ----
engine.eScript.SetScriptState(axscript.SCRIPTSTATE_UNINITIALIZED)
engine.eScript.SetScriptSite(util.wrap(site))
! print("restarting")
engine.Start()
# all done!
***************
*** 128,139 ****
try:
ob.hello("Goober")
! except pythoncom.com_error, exc:
! print "***** Calling 'hello' failed", exc
return
if echoer.last != "Goober":
! print "***** Function call didnt set value correctly", `echoer.last`
if str(ob.prop) != "Property Value":
! print "***** Property Value not correct - ", `ob.prop`
ob.testcollection()
--- 128,139 ----
try:
ob.hello("Goober")
! except pythoncom.com_error as exc:
! print("***** Calling 'hello' failed", exc)
return
if echoer.last != "Goober":
! print("***** Function call didnt set value correctly", `echoer.last`)
if str(ob.prop) != "Property Value":
! print("***** Property Value not correct - ", `ob.prop`)
ob.testcollection()
***************
*** 142,151 ****
result = engine.eParse.ParseScriptText("1+1", None, None, None, 0, 0, axscript.SCRIPTTEXT_ISEXPRESSION)
if result != 2:
! print "Engine could not evaluate '1+1' - said the result was", result
def dotestall():
for i in xrange(10):
TestEngine("Python", PyScript)
! print sys.gettotalrefcount()
## print "Testing Exceptions"
## try:
--- 142,151 ----
result = engine.eParse.ParseScriptText("1+1", None, None, None, 0, 0, axscript.SCRIPTTEXT_ISEXPRESSION)
if result != 2:
! print("Engine could not evaluate '1+1' - said the result was", result)
def dotestall():
for i in xrange(10):
TestEngine("Python", PyScript)
! print(sys.gettotalrefcount())
## print "Testing Exceptions"
## try:
***************
*** 158,162 ****
dotestall()
pythoncom.CoUninitialize()
! print "AXScript Host worked correctly - %d/%d COM objects left alive." % (pythoncom._GetInterfaceCount(), pythoncom._GetGatewayCount())
if __name__ == '__main__':
--- 158,162 ----
dotestall()
pythoncom.CoUninitialize()
! print("AXScript Host worked correctly - %d/%d COM objects left alive." % (pythoncom._GetInterfaceCount(), pythoncom._GetGatewayCount()))
if __name__ == '__main__':
|