Update of /cvsroot/pywin32/pywin32/com/win32comext/axscript/client
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/com/win32comext/axscript/client
Modified Files:
Tag: py3k
debug.py error.py framework.py pydumper.py pyscript.py
pyscript_rexec.py scriptdispatch.py
Log Message:
many more upgrades to py3k syntax
Index: debug.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/debug.py,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -C2 -d -r1.3 -r1.3.4.1
*** debug.py 11 Apr 2005 13:04:40 -0000 1.3
--- debug.py 26 Nov 2008 09:03:29 -0000 1.3.4.1
***************
*** 25,32 ****
if not debuggingTrace:
return
! print win32api.GetCurrentThreadId(),
for arg in args:
! print arg,
! print
# Note that the DebugManager is not a COM gateway class for the
--- 25,32 ----
if not debuggingTrace:
return
! print(win32api.GetCurrentThreadId(), end=' ')
for arg in args:
! print(arg, end=' ')
! print()
# Note that the DebugManager is not a COM gateway class for the
Index: scriptdispatch.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/scriptdispatch.py,v
retrieving revision 1.4
retrieving revision 1.4.4.1
diff -C2 -d -r1.4 -r1.4.4.1
*** scriptdispatch.py 20 May 2005 23:27:54 -0000 1.4
--- scriptdispatch.py 26 Nov 2008 09:03:29 -0000 1.4.4.1
***************
*** 38,42 ****
func = getattr(self.scriptNamespace, name)
if not _is_callable(func):
! raise AttributeError, name # Not a function.
realArgs = []
for arg in args:
--- 38,42 ----
func = getattr(self.scriptNamespace, name)
if not _is_callable(func):
! raise AttributeError(name) # Not a function.
realArgs = []
for arg in args:
***************
*** 48,52 ****
# xxx - todo - work out what code block to pass???
return self.engine.ApplyInScriptedSection(None, func, tuple(realArgs))
! except COMException, (hr, msg, exc, arg):
raise
--- 48,53 ----
# xxx - todo - work out what code block to pass???
return self.engine.ApplyInScriptedSection(None, func, tuple(realArgs))
! except COMException as xxx_todo_changeme:
! (hr, msg, exc, arg) = xxx_todo_changeme.args
raise
***************
*** 59,66 ****
ret = getattr(self.scriptNamespace, name)
if _is_callable(ret):
! raise AttributeError, name # Not a property.
except AttributeError:
raise COMException(scode=winerror.DISP_E_MEMBERNOTFOUND)
! except COMException, instance:
raise
except:
--- 60,67 ----
ret = getattr(self.scriptNamespace, name)
if _is_callable(ret):
! raise AttributeError(name) # Not a property.
except AttributeError:
raise COMException(scode=winerror.DISP_E_MEMBERNOTFOUND)
! except COMException as instance:
raise
except:
Index: pyscript.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/pyscript.py,v
retrieving revision 1.11.2.1
retrieving revision 1.11.2.2
diff -C2 -d -r1.11.2.1 -r1.11.2.2
*** pyscript.py 26 Nov 2008 07:17:39 -0000 1.11.2.1
--- pyscript.py 26 Nov 2008 09:03:29 -0000 1.11.2.2
***************
*** 54,61 ****
def __getattr__(self, attr):
if attr[1]=="_" and attr[:-1]=="_":
! raise AttributeError, attr
rc = self._FindAttribute_(attr)
if rc is None:
! raise AttributeError, attr
return rc
def _Close_(self):
--- 54,61 ----
def __getattr__(self, attr):
if attr[1]=="_" and attr[:-1]=="_":
! raise AttributeError(attr)
rc = self._FindAttribute_(attr)
if rc is None:
! raise AttributeError(attr)
return rc
def _Close_(self):
***************
*** 73,77 ****
except AttributeError:
pass
! raise AttributeError, attr
def _FindAttribute_(self, attr):
--- 73,77 ----
except AttributeError:
pass
! raise AttributeError(attr)
def _FindAttribute_(self, attr):
***************
*** 84,88 ****
# (mainly b/w compat)
return getattr(self._scriptEngine_.globalNameSpaceModule, attr)
! # raise AttributeError, attr
class NamedScriptAttribute:
--- 84,88 ----
# (mainly b/w compat)
return getattr(self._scriptEngine_.globalNameSpaceModule, attr)
! # raise AttributeError(attr)
class NamedScriptAttribute:
***************
*** 104,108 ****
if self._scriptItem_.dispatchContainer:
return getattr(self._scriptItem_.dispatchContainer,attr)
! raise AttributeError, attr
def __setattr__(self, attr, value):
# XXX - todo - if a known item, then should call its default
--- 104,108 ----
if self._scriptItem_.dispatchContainer:
return getattr(self._scriptItem_.dispatchContainer,attr)
! raise AttributeError(attr)
def __setattr__(self, attr, value):
# XXX - todo - if a known item, then should call its default
***************
*** 114,118 ****
except AttributeError:
pass
! raise AttributeError, attr
def _Close_(self):
self.__dict__['_scriptItem_'] = None
--- 114,118 ----
except AttributeError:
pass
! raise AttributeError(attr)
def _Close_(self):
self.__dict__['_scriptItem_'] = None
Index: pydumper.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/pydumper.py,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -C2 -d -r1.1 -r1.1.4.1
*** pydumper.py 1 Sep 1999 23:12:39 -0000 1.1
--- pydumper.py 26 Nov 2008 09:03:29 -0000 1.1.4.1
***************
*** 48,52 ****
policy = None # "win32com.axscript.client.axspolicy.AXScriptPolicy"
! print "Registering COM server%s..." % debug_desc
from win32com.server.register import RegisterServer
--- 48,52 ----
policy = None # "win32com.axscript.client.axspolicy.AXScriptPolicy"
! print("Registering COM server%s..." % debug_desc)
from win32com.server.register import RegisterServer
***************
*** 63,67 ****
win32com.server.register._set_string(".pysDump", "pysDumpFile")
win32com.server.register._set_string("pysDumpFile\\ScriptEngine", languageName)
! print "Dumping Server registered."
if __name__=='__main__':
--- 63,67 ----
win32com.server.register._set_string(".pysDump", "pysDumpFile")
win32com.server.register._set_string("pysDumpFile\\ScriptEngine", languageName)
! print("Dumping Server registered.")
if __name__=='__main__':
Index: framework.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/framework.py,v
retrieving revision 1.25
retrieving revision 1.25.2.1
diff -C2 -d -r1.25 -r1.25.2.1
*** framework.py 7 May 2007 02:27:44 -0000 1.25
--- framework.py 26 Nov 2008 09:03:29 -0000 1.25.2.1
***************
*** 79,83 ****
# it would be nice to get to the bottom of this, so a warning to
# the debug console can't hurt.
! print "WARNING: Ignoring keyboard interrupt from ActiveScripting engine"
# If someone else has already redirected, then assume they know what they are doing!
if signal.getsignal(signal.SIGINT) == signal.default_int_handler:
--- 79,83 ----
# it would be nice to get to the bottom of this, so a warning to
# the debug console can't hurt.
! print("WARNING: Ignoring keyboard interrupt from ActiveScripting engine")
# If someone else has already redirected, then assume they know what they are doing!
if signal.getsignal(signal.SIGINT) == signal.default_int_handler:
***************
*** 92,103 ****
"""
for arg in args:
! print arg,
! print
def RaiseAssert(scode, desc):
"""A debugging function that raises an exception considered an "Assertion".
"""
! print "**************** ASSERTION FAILED *******************"
! print desc
raise Exception(scode, desc)
--- 92,103 ----
"""
for arg in args:
! print(arg, end=' ')
! print()
def RaiseAssert(scode, desc):
"""A debugging function that raises an exception considered an "Assertion".
"""
! print("**************** ASSERTION FAILED *******************")
! print(desc)
raise Exception(scode, desc)
***************
*** 270,274 ****
if self.flags is not None and self.flags & axscript.SCRIPTITEM_CODEONLY:
flagDescs.append("CODE ONLY")
! print " " * level, "Name=", self.name, ", flags=", "/".join(flagDescs), self
for subItem in self.subItems.values():
subItem._dump_(level+1)
--- 270,274 ----
if self.flags is not None and self.flags & axscript.SCRIPTITEM_CODEONLY:
flagDescs.append("CODE ONLY")
! print(" " * level, "Name=", self.name, ", flags=", "/".join(flagDescs), self)
for subItem in self.subItems.values():
subItem._dump_(level+1)
***************
*** 829,833 ****
try:
if self.scriptSite: self.scriptSite.OnStateChange(state)
! except pythoncom.com_error, (hr, desc, exc, arg):
pass # Ignore all errors here - E_NOTIMPL likely from scriptlets.
finally:
--- 829,834 ----
try:
if self.scriptSite: self.scriptSite.OnStateChange(state)
! except pythoncom.com_error as xxx_todo_changeme:
! (hr, desc, exc, arg) = xxx_todo_changeme.args
pass # Ignore all errors here - E_NOTIMPL likely from scriptlets.
finally:
***************
*** 993,997 ****
if __name__=='__main__':
! print "This is a framework class - please use pyscript.py etc"
def dumptypeinfo(typeinfo):
--- 994,998 ----
if __name__=='__main__':
! print("This is a framework class - please use pyscript.py etc")
def dumptypeinfo(typeinfo):
***************
*** 999,1003 ****
attr = typeinfo.GetTypeAttr()
# Loop over all methods
! print "Methods"
for j in xrange(attr[6]):
fdesc = list(typeinfo.GetFuncDesc(j))
--- 1000,1004 ----
attr = typeinfo.GetTypeAttr()
# Loop over all methods
! print("Methods")
for j in xrange(attr[6]):
fdesc = list(typeinfo.GetFuncDesc(j))
***************
*** 1009,1018 ****
doc = typeinfo.GetDocumentation(id)
! print " ", names, "has attr", fdesc
# Loop over all variables (ie, properties)
! print "Variables"
for j in xrange(attr[7]):
fdesc = list(typeinfo.GetVarDesc(j))
names = typeinfo.GetNames(id)
! print " ", names, "has attr", fdesc
--- 1010,1019 ----
doc = typeinfo.GetDocumentation(id)
! print(" ", names, "has attr", fdesc)
# Loop over all variables (ie, properties)
! print("Variables")
for j in xrange(attr[7]):
fdesc = list(typeinfo.GetVarDesc(j))
names = typeinfo.GetNames(id)
! print(" ", names, "has attr", fdesc)
Index: error.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/error.py,v
retrieving revision 1.9.2.1
retrieving revision 1.9.2.2
diff -C2 -d -r1.9.2.1 -r1.9.2.2
*** error.py 26 Nov 2008 07:17:39 -0000 1.9.2.1
--- error.py 26 Nov 2008 09:03:29 -0000 1.9.2.2
***************
*** 38,42 ****
_public_methods_ = ["GetSourceLineText","GetSourcePosition","GetExceptionInfo"]
def _query_interface_(self, iid):
! print "IActiveScriptError QI - unknown IID", iid
return 0
def _SetExceptionInfo(self, exc):
--- 38,42 ----
_public_methods_ = ["GetSourceLineText","GetSourcePosition","GetExceptionInfo"]
def _query_interface_(self, iid):
! print("IActiveScriptError QI - unknown IID", iid)
return 0
def _SetExceptionInfo(self, exc):
***************
*** 182,186 ****
bits[i] = bits[i].decode('utf8')
! self.description = ExpandTabs(u''.join(bits))
# Clear tracebacks etc.
tb = tb_top = tb_look = None
--- 182,186 ----
bits[i] = bits[i].decode('utf8')
! self.description = ExpandTabs(''.join(bits))
# Clear tracebacks etc.
tb = tb_top = tb_look = None
***************
*** 229,236 ****
try:
result = scriptingSite.OnScriptError(gateway)
! except pythoncom.com_error, details:
! print "**OnScriptError failed:", details
! print "Exception description:'%s'" % (`exceptionInstance.description`)
! print "Exception text:'%s'" % (`exceptionInstance.linetext`)
result = winerror.S_FALSE
--- 229,236 ----
try:
result = scriptingSite.OnScriptError(gateway)
! except pythoncom.com_error as details:
! print("**OnScriptError failed:", details)
! print("Exception description:'%s'" % (`exceptionInstance.description`))
! print("Exception text:'%s'" % (`exceptionInstance.linetext`))
result = winerror.S_FALSE
Index: pyscript_rexec.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/pyscript_rexec.py,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -C2 -d -r1.3 -r1.3.4.1
*** pyscript_rexec.py 13 Feb 2005 12:26:33 -0000 1.3
--- pyscript_rexec.py 26 Nov 2008 09:03:29 -0000 1.3.4.1
***************
*** 36,43 ****
if __name__=='__main__':
! print "WARNING: By registering this engine, you are giving remote HTML code"
! print "the ability to execute *any* code on your system."
! print
! print "You almost certainly do NOT want to do this."
! print "You have been warned, and are doing this at your own (significant) risk"
pyscript.Register(PyScriptRExec)
--- 36,43 ----
if __name__=='__main__':
! print("WARNING: By registering this engine, you are giving remote HTML code")
! print("the ability to execute *any* code on your system.")
! print()
! print("You almost certainly do NOT want to do this.")
! print("You have been warned, and are doing this at your own (significant) risk")
pyscript.Register(PyScriptRExec)
|