pywin32-checkins Mailing List for Python for Windows Extensions (Page 53)
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(6) |
Jul
(50) |
Aug
(11) |
Sep
(24) |
Oct
(184) |
Nov
(118) |
Dec
(22) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(31) |
Feb
(25) |
Mar
(34) |
Apr
(105) |
May
(49) |
Jun
(38) |
Jul
(39) |
Aug
(7) |
Sep
(98) |
Oct
(79) |
Nov
(20) |
Dec
(17) |
2005 |
Jan
(66) |
Feb
(32) |
Mar
(43) |
Apr
(30) |
May
(58) |
Jun
(30) |
Jul
(16) |
Aug
(4) |
Sep
(21) |
Oct
(42) |
Nov
(11) |
Dec
(14) |
2006 |
Jan
(42) |
Feb
(30) |
Mar
(22) |
Apr
(1) |
May
(9) |
Jun
(15) |
Jul
(20) |
Aug
(9) |
Sep
(8) |
Oct
(1) |
Nov
(9) |
Dec
(43) |
2007 |
Jan
(52) |
Feb
(45) |
Mar
(20) |
Apr
(12) |
May
(59) |
Jun
(39) |
Jul
(35) |
Aug
(31) |
Sep
(17) |
Oct
(20) |
Nov
(4) |
Dec
(4) |
2008 |
Jan
(28) |
Feb
(111) |
Mar
(4) |
Apr
(27) |
May
(40) |
Jun
(27) |
Jul
(32) |
Aug
(94) |
Sep
(87) |
Oct
(153) |
Nov
(336) |
Dec
(331) |
2009 |
Jan
(298) |
Feb
(127) |
Mar
(20) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(1) |
2010 |
Jan
(7) |
Feb
(1) |
Mar
|
Apr
|
May
(15) |
Jun
(4) |
Jul
(3) |
Aug
(28) |
Sep
(1) |
Oct
(19) |
Nov
(16) |
Dec
(6) |
2011 |
Jan
(2) |
Feb
(18) |
Mar
(17) |
Apr
(12) |
May
(5) |
Jun
(11) |
Jul
(7) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(4) |
Dec
|
2012 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
(8) |
May
(4) |
Jun
(3) |
Jul
(13) |
Aug
(27) |
Sep
(8) |
Oct
(9) |
Nov
(3) |
Dec
(2) |
2013 |
Jan
|
Feb
(1) |
Mar
(5) |
Apr
(10) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(9) |
2014 |
Jan
(2) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(4) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(1) |
2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
(6) |
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(3) |
Feb
(2) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Mark H. <mha...@us...> - 2008-11-26 08:56:40
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19784/Lib Modified Files: win32verstamp.py Log Message: modernize syntax: all remaining raise statements in win32/* upgraded Index: win32verstamp.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32verstamp.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** win32verstamp.py 23 Oct 2005 11:31:07 -0000 1.2 --- win32verstamp.py 26 Nov 2008 08:56:33 -0000 1.3 *************** *** 123,127 **** vmaj, vmin, vsub, vbuild = bits except (IndexError, TypeError, ValueError): ! raise ValueError, "--version must be a.b.c.d (all integers) - got %r" % ver ifn = options.internal_name --- 123,127 ---- vmaj, vmin, vsub, vbuild = bits except (IndexError, TypeError, ValueError): ! raise ValueError("--version must be a.b.c.d (all integers) - got %r" % ver) ifn = options.internal_name |
From: Mark H. <mha...@us...> - 2008-11-26 08:56:40
|
Update of /cvsroot/pywin32/pywin32/win32/scripts In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19784/scripts Modified Files: regsetup.py Log Message: modernize syntax: all remaining raise statements in win32/* upgraded Index: regsetup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/scripts/regsetup.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** regsetup.py 30 May 2008 23:14:17 -0000 1.15 --- regsetup.py 26 Nov 2008 08:56:33 -0000 1.16 *************** *** 54,58 **** ret = os.path.abspath(pathLook) return ret, ret ! raise error, "The package %s can not be located" % packageName def FindHelpPath(helpFile, helpDesc, searchPaths): --- 54,58 ---- ret = os.path.abspath(pathLook) return ret, ret ! raise error("The package %s can not be located" % packageName) def FindHelpPath(helpFile, helpDesc, searchPaths): *************** *** 78,82 **** if FileExists(os.path.join( pathLook, helpFile)): return os.path.abspath(pathLook) ! raise error, "The help file %s can not be located" % helpFile def FindAppPath(appName, knownFileName, searchPaths): --- 78,82 ---- if FileExists(os.path.join( pathLook, helpFile)): return os.path.abspath(pathLook) ! raise error("The help file %s can not be located" % helpFile) def FindAppPath(appName, knownFileName, searchPaths): *************** *** 98,102 **** # Found it return os.path.abspath(pathLook) ! raise error, "The file %s can not be located for application %s" % (knownFileName, appName) def FindPythonExe(exeAlias, possibleRealNames, searchPaths): --- 98,102 ---- # Found it return os.path.abspath(pathLook) ! raise error("The file %s can not be located for application %s" % (knownFileName, appName)) def FindPythonExe(exeAlias, possibleRealNames, searchPaths): *************** *** 161,165 **** import win32ui, win32con except ImportError: ! raise error, "Need to locate the file %s, but the win32ui module is not available\nPlease run the program again, passing as a parameter the path to this file." % fileName # Display a common dialog to locate the file. flags=win32con.OFN_FILEMUSTEXIST --- 161,165 ---- import win32ui, win32con except ImportError: ! raise error("Need to locate the file %s, but the win32ui module is not available\nPlease run the program again, passing as a parameter the path to this file." % fileName) # Display a common dialog to locate the file. flags=win32con.OFN_FILEMUSTEXIST *************** *** 169,173 **** dlg.SetOFNTitle("Locate " + fileName) if dlg.DoModal() <> win32con.IDOK: ! raise KeyboardInterrupt, "User cancelled the process" retPath = dlg.GetPathName() return os.path.abspath(retPath) --- 169,173 ---- dlg.SetOFNTitle("Locate " + fileName) if dlg.DoModal() <> win32con.IDOK: ! raise KeyboardInterrupt("User cancelled the process") retPath = dlg.GetPathName() return os.path.abspath(retPath) *************** *** 215,219 **** libPath = LocatePath("os.py", searchPaths) if libPath is None: ! raise error, "The core Python library could not be located." corePath = None --- 215,219 ---- libPath = LocatePath("os.py", searchPaths) if libPath is None: ! raise error("The core Python library could not be located.") corePath = None *************** *** 226,230 **** corePath = LocatePath("unicodedata%s.pyd" % suffix, searchPaths) if corePath is None: ! raise error, "The core Python path could not be located." installPath = os.path.abspath(os.path.join(libPath, "..")) --- 226,230 ---- corePath = LocatePath("unicodedata%s.pyd" % suffix, searchPaths) if corePath is None: ! raise error("The core Python path could not be located.") installPath = os.path.abspath(os.path.join(libPath, "..")) *************** *** 242,246 **** """ import regutil, string ! if not packageName: raise error, "A package name must be supplied" corePaths = string.split(regutil.GetRegisteredNamedPath(None),";") if not searchPaths: searchPaths = corePaths --- 242,246 ---- """ import regutil, string ! if not packageName: raise error("A package name must be supplied") corePaths = string.split(regutil.GetRegisteredNamedPath(None),";") if not searchPaths: searchPaths = corePaths *************** *** 498,502 **** if o=='-c': if not len(searchPaths): ! raise error, "-c option must provide at least one additional path" import win32api, regutil currentPaths = string.split(regutil.GetRegisteredNamedPath(None),";") --- 498,502 ---- if o=='-c': if not len(searchPaths): ! raise error("-c option must provide at least one additional path") import win32api, regutil currentPaths = string.split(regutil.GetRegisteredNamedPath(None),";") |
From: Mark H. <mha...@us...> - 2008-11-26 08:56:40
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19784/Demos Modified Files: win32gui_dialog.py Log Message: modernize syntax: all remaining raise statements in win32/* upgraded Index: win32gui_dialog.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32gui_dialog.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** win32gui_dialog.py 3 Oct 2008 01:03:56 -0000 1.8 --- win32gui_dialog.py 26 Nov 2008 08:56:33 -0000 1.9 *************** *** 46,55 **** for name, val in kw.items(): if not self.__dict__.has_key(name): ! raise ValueError, "LVITEM structures do not have an item '%s'" % (name,) self.__dict__[name] = val def __setattr__(self, attr, val): if not attr.startswith("_") and not self.__dict__.has_key(attr): ! raise AttributeError, attr self.__dict__[attr] = val --- 46,55 ---- for name, val in kw.items(): if not self.__dict__.has_key(name): ! raise ValueError("LVITEM structures do not have an item '%s'" % (name,)) self.__dict__[name] = val def __setattr__(self, attr, val): if not attr.startswith("_") and not self.__dict__.has_key(attr): ! raise AttributeError(attr) self.__dict__[attr] = val |
From: Mark H. <mha...@us...> - 2008-11-26 08:52:44
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/authorization/demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19471/win32comext/authorization/demos Modified Files: EditSecurity.py EditServiceSecurity.py Log Message: modernize syntax: all remaining raise statements in com/* upgraded Index: EditServiceSecurity.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/authorization/demos/EditServiceSecurity.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EditServiceSecurity.py 26 Jul 2006 03:12:53 -0000 1.1 --- EditServiceSecurity.py 26 Nov 2008 08:52:32 -0000 1.2 *************** *** 75,79 **** if (objecttype is not None) and (objecttype!=IID_NULL): ## Not relevent for services ! raise NotImplementedError, "Object type is not supported" ## ???? for some reason, the DACL for a service will not retain ACCESS_SYSTEM_SECURITY in an ACE ???? --- 75,79 ---- if (objecttype is not None) and (objecttype!=IID_NULL): ## Not relevent for services ! raise NotImplementedError("Object type is not supported") ## ???? for some reason, the DACL for a service will not retain ACCESS_SYSTEM_SECURITY in an ACE ???? Index: EditSecurity.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/authorization/demos/EditSecurity.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EditSecurity.py 16 Mar 2006 22:53:08 -0000 1.1 --- EditSecurity.py 26 Nov 2008 08:52:32 -0000 1.2 *************** *** 77,81 **** ## Should not be true for file objects. Usually only used with DS objects that support security for ## their properties ! raise NotImplementedError, "Object type is not supported" if os.path.isdir(self.FileName): --- 77,81 ---- ## Should not be true for file objects. Usually only used with DS objects that support security for ## their properties ! raise NotImplementedError("Object type is not supported") if os.path.isdir(self.FileName): |
From: Mark H. <mha...@us...> - 2008-11-26 08:52:39
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/adsi In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19471/win32comext/adsi Modified Files: __init__.py Log Message: modernize syntax: all remaining raise statements in com/* upgraded Index: __init__.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/adsi/__init__.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** __init__.py 27 May 2005 07:08:30 -0000 1.2 --- __init__.py 26 Nov 2008 08:52:32 -0000 1.3 *************** *** 53,60 **** return self.__GetIndex(index) def __GetIndex(self, index): ! if type(index)!=type(0): raise TypeError, "Only integer indexes are supported for enumerators" if index != self.index + 1: # Index requested out of sequence. ! raise ValueError, "You must index this object sequentially" self.index = index result = ADsEnumerateNext(self._oleobj_, 1) --- 53,60 ---- return self.__GetIndex(index) def __GetIndex(self, index): ! if type(index)!=type(0): raise TypeError("Only integer indexes are supported for enumerators") if index != self.index + 1: # Index requested out of sequence. ! raise ValueError("You must index this object sequentially") self.index = index result = ADsEnumerateNext(self._oleobj_, 1) *************** *** 64,68 **** self.index = -1 self._oleobj_ = ADsBuildEnumerator(self._cont_) # a PyIADsEnumVARIANT ! raise IndexError, "list index out of range" class ADSIDispatch(win32com.client.CDispatch): --- 64,68 ---- self.index = -1 self._oleobj_ = ADsBuildEnumerator(self._cont_) # a PyIADsEnumVARIANT ! raise IndexError("list index out of range") class ADSIDispatch(win32com.client.CDispatch): |
From: Mark H. <mha...@us...> - 2008-11-26 08:52:37
|
Update of /cvsroot/pywin32/pywin32/com/win32com/server In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19471/win32com/server Modified Files: dispatcher.py policy.py register.py Log Message: modernize syntax: all remaining raise statements in com/* upgraded Index: policy.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/server/policy.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** policy.py 26 Nov 2008 01:48:48 -0000 1.24 --- policy.py 26 Nov 2008 08:52:32 -0000 1.25 *************** *** 191,195 **** regSpec % clsid) except win32api.error: ! raise error, "The object is not correctly registered - %s key can not be read" % (regSpec % clsid) myob = call_func(classSpec) self._wrap_(myob) --- 191,195 ---- regSpec % clsid) except win32api.error: ! raise error("The object is not correctly registered - %s key can not be read" % (regSpec % clsid)) myob = call_func(classSpec) self._wrap_(myob) *************** *** 201,205 **** "interface '%s'(%s): %s" \ % (myob, IIDToInterfaceName(reqIID), reqIID, desc) ! raise pythoncom.com_error, (hr, desc, exc, arg) --- 201,205 ---- "interface '%s'(%s): %s" \ % (myob, IIDToInterfaceName(reqIID), reqIID, desc) ! raise pythoncom.com_error(hr, desc, exc, arg) *************** *** 330,334 **** """ # Base classes should override this method (and not call the base) ! raise error, "This class does not provide _invokeex_ semantics" def _DeleteMemberByName_(self, name, fdex): --- 330,334 ---- """ # Base classes should override this method (and not call the base) ! raise error("This class does not provide _invokeex_ semantics") def _DeleteMemberByName_(self, name, fdex): *************** *** 469,473 **** MappedWrapPolicy._wrap_(self, ob) if not hasattr(ob, '_public_methods_') and not hasattr(ob, "_typelib_guid_"): ! raise error, "Object does not support DesignatedWrapPolicy, as it does not have either _public_methods_ or _typelib_guid_ attributes." # Copy existing _dispid_to_func_ entries to _name_to_dispid_ --- 469,473 ---- MappedWrapPolicy._wrap_(self, ob) if not hasattr(ob, '_public_methods_') and not hasattr(ob, "_typelib_guid_"): ! raise error("Object does not support DesignatedWrapPolicy, as it does not have either _public_methods_ or _typelib_guid_ attributes.") # Copy existing _dispid_to_func_ entries to _name_to_dispid_ *************** *** 489,493 **** self._dispid_to_get_[dispid] = name else: ! raise ValueError, "unexpected invkind: %d (%s)" % (invkind,name) # look for reserved methods --- 489,493 ---- self._dispid_to_get_[dispid] = name else: ! raise ValueError("unexpected invkind: %d (%s)" % (invkind,name)) # look for reserved methods *************** *** 669,673 **** BasicWrapPolicy._wrap_(self, object) if not hasattr(self._obj_, '_dynamic_'): ! raise error, "Object does not support Dynamic COM Policy" self._next_dynamic_ = self._min_dynamic_ = 1000 self._dyn_dispid_to_name_ = {DISPID_VALUE:'_value_', DISPID_NEWENUM:'_NewEnum' } --- 669,673 ---- BasicWrapPolicy._wrap_(self, object) if not hasattr(self._obj_, '_dynamic_'): ! raise error("Object does not support Dynamic COM Policy") self._next_dynamic_ = self._min_dynamic_ = 1000 self._dyn_dispid_to_name_ = {DISPID_VALUE:'_value_', DISPID_NEWENUM:'_NewEnum' } Index: register.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/server/register.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** register.py 10 Feb 2008 13:27:13 -0000 1.21 --- register.py 26 Nov 2008 08:52:32 -0000 1.22 *************** *** 47,51 **** except win32api.error, (code, fn, msg): if code != winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error, (code, fn, msg) def recurse_delete_key(path, base=win32con.HKEY_CLASSES_ROOT): --- 47,51 ---- except win32api.error, (code, fn, msg): if code != winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, msg) def recurse_delete_key(path, base=win32con.HKEY_CLASSES_ROOT): *************** *** 58,62 **** except win32api.error, (code, fn, msg): if code != winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error, (code, fn, msg) else: # parent key found and opened successfully. do some work, making sure --- 58,62 ---- except win32api.error, (code, fn, msg): if code != winerror.ERROR_FILE_NOT_FOUND: ! raise win32api.error(code, fn, msg) else: # parent key found and opened successfully. do some work, making sure *************** *** 69,73 **** except win32api.error, (code, fn, msg): if code != winerror.ERROR_NO_MORE_ITEMS: ! raise win32api.error, (code, fn, msg) break recurse_delete_key(path + '\\' + subkeyname, base) --- 69,73 ---- except win32api.error, (code, fn, msg): if code != winerror.ERROR_NO_MORE_ITEMS: ! raise win32api.error(code, fn, msg) break recurse_delete_key(path + '\\' + subkeyname, base) *************** *** 111,115 **** if not os.path.exists(exeName): if mustfind: ! raise RuntimeError, "Can not locate the program '%s'" % exeBaseName return None return exeName --- 111,115 ---- if not os.path.exists(exeName): if mustfind: ! raise RuntimeError("Can not locate the program '%s'" % exeBaseName) return None return exeName *************** *** 132,136 **** os.stat(pyfile) except os.error: ! raise RuntimeError, "Can not locate the Python module 'win32com.server.%s'" % baseName return pyfile --- 132,136 ---- os.stat(pyfile) except os.error: ! raise RuntimeError("Can not locate the Python module 'win32com.server.%s'" % baseName) return pyfile *************** *** 176,180 **** ### Certain policies do not require a "class name", just the policy itself. if not pythonInstString and not policy: ! raise TypeError, 'You must specify either the Python Class or Python Policy which implement the COM object.' keyNameRoot = "CLSID\\%s" % str(clsid) --- 176,180 ---- ### Certain policies do not require a "class name", just the policy itself. if not pythonInstString and not policy: ! raise TypeError('You must specify either the Python Class or Python Policy which implement the COM object.') keyNameRoot = "CLSID\\%s" % str(clsid) *************** *** 205,209 **** dllName = win32api.GetModuleFileName(sys.frozendllhandle) else: ! raise RuntimeError, "We appear to have a frozen DLL, but I don't know the DLL to use" else: # Normal case - running from .py file, so register pythoncom's DLL. --- 205,209 ---- dllName = win32api.GetModuleFileName(sys.frozendllhandle) else: ! raise RuntimeError("We appear to have a frozen DLL, but I don't know the DLL to use") else: # Normal case - running from .py file, so register pythoncom's DLL. *************** *** 402,406 **** except (IndexError, win32api.error): # Can't find the script file - the user must explicitely set the _reg_... attribute. ! raise TypeError, "Can't locate the script hosting the COM object - please set _reg_class_spec_ in your object" spec = moduleName + "." + cls.__name__ --- 402,406 ---- except (IndexError, win32api.error): # Can't find the script file - the user must explicitely set the _reg_... attribute. ! raise TypeError("Can't locate the script hosting the COM object - please set _reg_class_spec_ in your object") spec = moduleName + "." + cls.__name__ Index: dispatcher.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/server/dispatcher.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** dispatcher.py 12 Apr 2005 04:28:44 -0000 1.6 --- dispatcher.py 26 Nov 2008 08:52:32 -0000 1.7 *************** *** 247,251 **** debug = 0 try: ! raise typ, val except Exception: # AARG - What is this Exception??? # Use some inside knowledge to borrow a Debugger option which dictates if we --- 247,251 ---- debug = 0 try: ! raise typ(val) except Exception: # AARG - What is this Exception??? # Use some inside knowledge to borrow a Debugger option which dictates if we *************** *** 275,279 **** """ t, v, tb = exc_info() ! raise t, v, tb try: --- 275,279 ---- """ t, v, tb = exc_info() ! raise t(v).with_traceback(tb) try: |
From: Mark H. <mha...@us...> - 2008-11-26 08:52:37
|
Update of /cvsroot/pywin32/pywin32/com/win32com/makegw In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19471/win32com/makegw Modified Files: makegwparse.py Log Message: modernize syntax: all remaining raise statements in com/* upgraded Index: makegwparse.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/makegw/makegwparse.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** makegwparse.py 27 Jul 2008 06:44:59 -0000 1.13 --- makegwparse.py 26 Nov 2008 08:52:32 -0000 1.14 *************** *** 58,62 **** else: return "?? (%d)" % (dif,) ! raise error_not_supported, "Can't indirect this far - please fix me :-)" def GetIndirectedArgName(self, indirectFrom, indirectionTo): #print 'get:',self.arg.name, indirectFrom,self._GetDeclaredIndirection() + self.builtinIndirection, indirectionTo, self.arg.indirectionLevel --- 58,62 ---- else: return "?? (%d)" % (dif,) ! raise error_not_supported("Can't indirect this far - please fix me :-)") def GetIndirectedArgName(self, indirectFrom, indirectionTo): #print 'get:',self.arg.name, indirectFrom,self._GetDeclaredIndirection() + self.builtinIndirection, indirectionTo, self.arg.indirectionLevel *************** *** 586,590 **** return ArgFormatterInterface(arg, 0, 1) ! raise error_not_supported, "The type '%s' (%s) is unknown." % (arg.type, arg.name) --- 586,590 ---- return ArgFormatterInterface(arg, 0, 1) ! raise error_not_supported("The type '%s' (%s) is unknown." % (arg.type, arg.name)) |
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19471/win32com/test Modified Files: errorSemantics.py pippo_server.py policySemantics.py testAccess.py testCollections.py testDictionary.py testDynamic.py testExplorer.py testGIT.py testMSOffice.py testMSOfficeEvents.py testNetscape.py testPyComTest.py testStreams.py testall.py util.py Log Message: modernize syntax: all remaining raise statements in com/* upgraded Index: testMSOfficeEvents.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testMSOfficeEvents.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** testMSOfficeEvents.py 18 Mar 2003 23:00:35 -0000 1.4 --- testMSOfficeEvents.py 26 Nov 2008 08:52:32 -0000 1.5 *************** *** 12,20 **** def OnNewWorkbook(self, wb): if type(wb) != types.InstanceType: ! raise RuntimeError, "The transformer doesnt appear to have translated this for us!" self.seen_events["OnNewWorkbook"] = None def OnWindowActivate(self, wb, wn): if type(wb) != types.InstanceType or type(wn) != types.InstanceType: ! raise RuntimeError, "The transformer doesnt appear to have translated this for us!" self.seen_events["OnWindowActivate"] = None def OnWindowDeactivate(self, wb, wn): --- 12,20 ---- def OnNewWorkbook(self, wb): if type(wb) != types.InstanceType: ! raise RuntimeError("The transformer doesnt appear to have translated this for us!") self.seen_events["OnNewWorkbook"] = None def OnWindowActivate(self, wb, wn): if type(wb) != types.InstanceType or type(wn) != types.InstanceType: ! raise RuntimeError("The transformer doesnt appear to have translated this for us!") self.seen_events["OnWindowActivate"] = None def OnWindowDeactivate(self, wb, wn): Index: policySemantics.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/policySemantics.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** policySemantics.py 26 Nov 2008 01:16:13 -0000 1.5 --- policySemantics.py 26 Nov 2008 08:52:32 -0000 1.6 *************** *** 50,54 **** dispids.sort() if dispids <> [pythoncom.DISPID_EVALUATE, pythoncom.DISPID_NEWENUM, 10, 11, 1000]: ! raise Error, "Got back the wrong dispids: %s" % dispids def SemanticTest(ob): --- 50,54 ---- dispids.sort() if dispids <> [pythoncom.DISPID_EVALUATE, pythoncom.DISPID_NEWENUM, 10, 11, 1000]: ! raise Error("Got back the wrong dispids: %s" % dispids) def SemanticTest(ob): *************** *** 59,63 **** # invoke _value_ if ob() != (1,2,3): ! raise Error, "Bad result - got %s" % (`ob()`) dispob = ob._oleobj_ --- 59,63 ---- # invoke _value_ if ob() != (1,2,3): ! raise Error("Bad result - got %s" % (`ob()`)) dispob = ob._oleobj_ *************** *** 65,69 **** rc = dispob.Invoke(pythoncom.DISPID_EVALUATE, 0, pythoncom.DISPATCH_METHOD|pythoncom.DISPATCH_PROPERTYGET, 1) if rc != 6: ! raise Error, "Evaluate returned", rc --- 65,69 ---- rc = dispob.Invoke(pythoncom.DISPID_EVALUATE, 0, pythoncom.DISPATCH_METHOD|pythoncom.DISPATCH_PROPERTYGET, 1) if rc != 6: ! raise Error("Evaluate returned").with_traceback(rc) Index: testAccess.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testAccess.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** testAccess.py 25 Apr 2004 03:58:12 -0000 1.6 --- testAccess.py 26 Nov 2008 08:52:32 -0000 1.7 *************** *** 88,99 **** tab1.MoveLast() if tab1.Fields("First Name").Value != "Second": ! raise RuntimeError, "Unexpected record is last - makes bookmark test pointless!" tab1.Bookmark = bk if tab1.Bookmark != bk: ! raise RuntimeError, "The bookmark data is not the same" if tab1.Fields("First Name").Value != "Mark": ! raise RuntimeError, "The bookmark did not reset the record pointer correctly" return dbname --- 88,99 ---- tab1.MoveLast() if tab1.Fields("First Name").Value != "Second": ! raise RuntimeError("Unexpected record is last - makes bookmark test pointless!") tab1.Bookmark = bk if tab1.Bookmark != bk: ! raise RuntimeError("The bookmark data is not the same") if tab1.Fields("First Name").Value != "Mark": ! raise RuntimeError("The bookmark did not reset the record pointer correctly") return dbname Index: testPyComTest.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testPyComTest.py,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** testPyComTest.py 26 Nov 2008 01:27:40 -0000 1.34 --- testPyComTest.py 26 Nov 2008 08:52:32 -0000 1.35 *************** *** 24,28 **** print "The PyCOMTest module can not be located or generated." print importMsg ! raise RuntimeError, importMsg # We had a bg where RegisterInterfaces would fail if gencache had --- 24,28 ---- print "The PyCOMTest module can not be located or generated." print importMsg ! raise RuntimeError(importMsg) # We had a bg where RegisterInterfaces would fail if gencache had *************** *** 49,53 **** rc = apply(fn, args) if rc != result: ! raise error, "%s failed - result not %r but %r" % (pref, result, rc) def TestConstant(constName, pyConst): --- 49,53 ---- rc = apply(fn, args) if rc != result: ! raise error("%s failed - result not %r but %r" % (pref, result, rc)) def TestConstant(constName, pyConst): *************** *** 55,61 **** comConst = getattr(constants, constName) except: ! raise error, "Constant %s missing" % (constName,) if comConst != pyConst: ! raise error, "Constant value wrong for %s - got %s, wanted %s" % (constName, comConst, pyConst) # Simple handler class. This demo only fires one event. --- 55,61 ---- comConst = getattr(constants, constName) except: ! raise error("Constant %s missing" % (constName,)) if comConst != pyConst: ! raise error("Constant value wrong for %s - got %s, wanted %s" % (constName, comConst, pyConst)) # Simple handler class. This demo only fires one event. *************** *** 100,116 **** if rc[:-1] != ("def", 0, 1) or abs(rc[-1]-3.14)>.01: print rc ! raise error, "Did not get the optional values correctly" rc = o.TestOptionals("Hi", 2, 3, 1.1) if rc[:-1] != ("Hi", 2, 3) or abs(rc[-1]-1.1)>.01: print rc ! raise error, "Did not get the specified optional values correctly" rc = o.TestOptionals2(0) if rc != (0, "", 1): print rc ! raise error, "Did not get the optional2 values correctly" rc = o.TestOptionals2(1.1, "Hi", 2) if rc[1:] != ("Hi", 2) or abs(rc[0]-1.1)>.01: print rc ! raise error, "Did not get the specified optional2 values correctly" # if verbose: print "Testing structs" --- 100,116 ---- if rc[:-1] != ("def", 0, 1) or abs(rc[-1]-3.14)>.01: print rc ! raise error("Did not get the optional values correctly") rc = o.TestOptionals("Hi", 2, 3, 1.1) if rc[:-1] != ("Hi", 2, 3) or abs(rc[-1]-1.1)>.01: print rc ! raise error("Did not get the specified optional values correctly") rc = o.TestOptionals2(0) if rc != (0, "", 1): print rc ! raise error("Did not get the optional2 values correctly") rc = o.TestOptionals2(1.1, "Hi", 2) if rc[1:] != ("Hi", 2) or abs(rc[0]-1.1)>.01: print rc ! raise error("Did not get the specified optional2 values correctly") # if verbose: print "Testing structs" *************** *** 129,136 **** o.LongProp = 3 if o.LongProp != 3 or o.IntProp != 3: ! raise error, "Property value wrong - got %d/%d" % (o.LongProp,o.IntProp) o.LongProp = o.IntProp = -3 if o.LongProp != -3 or o.IntProp != -3: ! raise error, "Property value wrong - got %d/%d" % (o.LongProp,o.IntProp) # This number fits in an unsigned long. Attempting to set it to a normal # long will involve overflow, which is to be expected. But we do --- 129,136 ---- o.LongProp = 3 if o.LongProp != 3 or o.IntProp != 3: ! raise error("Property value wrong - got %d/%d" % (o.LongProp,o.IntProp)) o.LongProp = o.IntProp = -3 if o.LongProp != -3 or o.IntProp != -3: ! raise error("Property value wrong - got %d/%d" % (o.LongProp,o.IntProp)) # This number fits in an unsigned long. Attempting to set it to a normal # long will involve overflow, which is to be expected. But we do *************** *** 139,147 **** o.ULongProp = check if o.ULongProp != check: ! raise error, "Property value wrong - got %d (expected %d)" % (o.ULongProp, check) # currency. pythoncom.__future_currency__ = 1 if o.CurrencyProp != 0: ! raise error, "Expecting 0, got %r" % (o.CurrencyProp,) try: import decimal --- 139,147 ---- o.ULongProp = check if o.ULongProp != check: ! raise error("Property value wrong - got %d (expected %d)" % (o.ULongProp, check)) # currency. pythoncom.__future_currency__ = 1 if o.CurrencyProp != 0: ! raise error("Expecting 0, got %r" % (o.CurrencyProp,)) try: import decimal *************** *** 150,154 **** o.CurrencyProp = decimal.Decimal("1234.5678") if o.CurrencyProp != decimal.Decimal("1234.5678"): ! raise error, "got %r" % (o.CurrencyProp,) v1 = decimal.Decimal("1234.5678") # can't do "DoubleCurrencyByVal" in dynamic files. --- 150,154 ---- o.CurrencyProp = decimal.Decimal("1234.5678") if o.CurrencyProp != decimal.Decimal("1234.5678"): ! raise error("got %r" % (o.CurrencyProp,)) v1 = decimal.Decimal("1234.5678") # can't do "DoubleCurrencyByVal" in dynamic files. *************** *** 183,187 **** if type(i1) != types.InstanceType or type(i2) != types.InstanceType: # Yay - is now an instance returned! ! raise error, "GetMultipleInterfaces did not return instances - got '%s', '%s'" % (i1, i2) del i1 del i2 --- 183,187 ---- if type(i1) != types.InstanceType or type(i2) != types.InstanceType: # Yay - is now an instance returned! ! raise error("GetMultipleInterfaces did not return instances - got '%s', '%s'" % (i1, i2)) del i1 del i2 *************** *** 191,244 **** if rc[:-1] != ("def", 0, 1) or abs(rc[-1]-3.14)>.01: print rc ! raise error, "Did not get the optional values correctly" rc = o.TestOptionals("Hi", 2, 3, 1.1) if rc[:-1] != ("Hi", 2, 3) or abs(rc[-1]-1.1)>.01: print rc ! raise error, "Did not get the specified optional values correctly" rc = o.TestOptionals2(0) if rc != (0, "", 1): print rc ! raise error, "Did not get the optional2 values correctly" rc = o.TestOptionals2(1.1, "Hi", 2) if rc[1:] != ("Hi", 2) or abs(rc[0]-1.1)>.01: print rc ! raise error, "Did not get the specified optional2 values correctly" progress("Checking var args") o.SetVarArgs("Hi", "There", "From", "Python", 1) if o.GetLastVarArgs() != ("Hi", "There", "From", "Python", 1): ! raise error, "VarArgs failed -" + str(o.GetLastVarArgs()) progress("Checking getting/passing IUnknown") if o.GetSetUnknown(o) != o: ! raise error, "GetSetUnknown failed" progress("Checking getting/passing IDispatch") if type(o.GetSetDispatch(o)) !=types.InstanceType: ! raise error, "GetSetDispatch failed" progress("Checking getting/passing IDispatch of known type") if o.GetSetInterface(o).__class__ != o.__class__: ! raise error, "GetSetDispatch failed" if o.GetSetVariant(4) != 4: ! raise error, "GetSetVariant (int) failed" if o.GetSetVariant("foo") != "foo": ! raise error, "GetSetVariant (str) failed" if o.GetSetVariant(o) != o: ! raise error, "GetSetVariant (dispatch) failed" for l in sys.maxint, sys.maxint+1, 1 << 65L: if o.GetSetVariant(l) != l: ! raise error, "GetSetVariant (long) failed" if o.TestByRefVariant(2) != 4: ! raise error, "TestByRefVariant failed" if o.TestByRefString("Foo") != "FooFoo": ! raise error, "TestByRefString failed" # Pass some non-sequence objects to our array decoder, and watch it fail. try: o.SetVariantSafeArray("foo") ! raise error, "Expected a type error" except TypeError: pass try: o.SetVariantSafeArray(666) ! raise error, "Expected a type error" except TypeError: pass --- 191,244 ---- if rc[:-1] != ("def", 0, 1) or abs(rc[-1]-3.14)>.01: print rc ! raise error("Did not get the optional values correctly") rc = o.TestOptionals("Hi", 2, 3, 1.1) if rc[:-1] != ("Hi", 2, 3) or abs(rc[-1]-1.1)>.01: print rc ! raise error("Did not get the specified optional values correctly") rc = o.TestOptionals2(0) if rc != (0, "", 1): print rc ! raise error("Did not get the optional2 values correctly") rc = o.TestOptionals2(1.1, "Hi", 2) if rc[1:] != ("Hi", 2) or abs(rc[0]-1.1)>.01: print rc ! raise error("Did not get the specified optional2 values correctly") progress("Checking var args") o.SetVarArgs("Hi", "There", "From", "Python", 1) if o.GetLastVarArgs() != ("Hi", "There", "From", "Python", 1): ! raise error("VarArgs failed -" + str(o.GetLastVarArgs())) progress("Checking getting/passing IUnknown") if o.GetSetUnknown(o) != o: ! raise error("GetSetUnknown failed") progress("Checking getting/passing IDispatch") if type(o.GetSetDispatch(o)) !=types.InstanceType: ! raise error("GetSetDispatch failed") progress("Checking getting/passing IDispatch of known type") if o.GetSetInterface(o).__class__ != o.__class__: ! raise error("GetSetDispatch failed") if o.GetSetVariant(4) != 4: ! raise error("GetSetVariant (int) failed") if o.GetSetVariant("foo") != "foo": ! raise error("GetSetVariant (str) failed") if o.GetSetVariant(o) != o: ! raise error("GetSetVariant (dispatch) failed") for l in sys.maxint, sys.maxint+1, 1 << 65L: if o.GetSetVariant(l) != l: ! raise error("GetSetVariant (long) failed") if o.TestByRefVariant(2) != 4: ! raise error("TestByRefVariant failed") if o.TestByRefString("Foo") != "FooFoo": ! raise error("TestByRefString failed") # Pass some non-sequence objects to our array decoder, and watch it fail. try: o.SetVariantSafeArray("foo") ! raise error("Expected a type error") except TypeError: pass try: o.SetVariantSafeArray(666) ! raise error("Expected a type error") except TypeError: pass *************** *** 297,315 **** o.LongProp = 3 if o.LongProp != 3 or o.IntProp != 3: ! raise error, "Property value wrong - got %d/%d" % (o.LongProp,o.IntProp) o.LongProp = o.IntProp = -3 if o.LongProp != -3 or o.IntProp != -3: ! raise error, "Property value wrong - got %d/%d" % (o.LongProp,o.IntProp) check = 3 *10 **9 o.ULongProp = check if o.ULongProp != check: ! raise error, "Property value wrong - got %d (expected %d)" % (o.ULongProp, check) # currency. pythoncom.__future_currency__ = 1 if o.CurrencyProp != 0: ! raise error, "Expecting 0, got %r" % (o.CurrencyProp,) try: import decimal --- 297,315 ---- o.LongProp = 3 if o.LongProp != 3 or o.IntProp != 3: ! raise error("Property value wrong - got %d/%d" % (o.LongProp,o.IntProp)) o.LongProp = o.IntProp = -3 if o.LongProp != -3 or o.IntProp != -3: ! raise error("Property value wrong - got %d/%d" % (o.LongProp,o.IntProp)) check = 3 *10 **9 o.ULongProp = check if o.ULongProp != check: ! raise error("Property value wrong - got %d (expected %d)" % (o.ULongProp, check)) # currency. pythoncom.__future_currency__ = 1 if o.CurrencyProp != 0: ! raise error("Expecting 0, got %r" % (o.CurrencyProp,)) try: import decimal *************** *** 319,323 **** o.CurrencyProp = decimal.Decimal(val) if o.CurrencyProp != decimal.Decimal(val): ! raise error, "%s got %r" % (val, o.CurrencyProp) v1 = decimal.Decimal("1234.5678") TestApplyResult(o.DoubleCurrency, (v1,), v1*2) --- 319,323 ---- o.CurrencyProp = decimal.Decimal(val) if o.CurrencyProp != decimal.Decimal(val): ! raise error("%s got %r" % (val, o.CurrencyProp)) v1 = decimal.Decimal("1234.5678") TestApplyResult(o.DoubleCurrency, (v1,), v1*2) *************** *** 328,332 **** o.SetParamProp(0, 1) if o.ParamProp(0) != 1: ! raise RuntimeError, o.paramProp(0) # Do the connection point thing... --- 328,332 ---- o.SetParamProp(0, 1) if o.ParamProp(0) != 1: ! raise RuntimeError(o.paramProp(0)) # Do the connection point thing... *************** *** 358,364 **** ret = counter[num] if ret != num+1: ! raise error, "Random access into element %d failed - return was %s" % (num,`ret`) except IndexError: ! raise error, "** IndexError accessing collection element %d" % num num = 0 --- 358,364 ---- ret = counter[num] if ret != num+1: ! raise error("Random access into element %d failed - return was %s" % (num,`ret`)) except IndexError: ! raise error("** IndexError accessing collection element %d" % num) num = 0 *************** *** 368,374 **** counter.SetTestProperty(1,2) if counter.TestPropertyWithDef != 0: ! raise error, "Unexpected property set value!" if counter.TestPropertyNoDef(1) != 1: ! raise error, "Unexpected property set value!" else: pass --- 368,374 ---- counter.SetTestProperty(1,2) if counter.TestPropertyWithDef != 0: ! raise error("Unexpected property set value!") if counter.TestPropertyNoDef(1) != 1: ! raise error("Unexpected property set value!") else: pass *************** *** 383,387 **** bounds = counter.GetBounds() if bounds[0]<>1 or bounds[1]<>10: ! raise error, "** Error - counter did not give the same properties back" counter.SetBounds(bounds[0], bounds[1]) --- 383,387 ---- bounds = counter.GetBounds() if bounds[0]<>1 or bounds[1]<>10: ! raise error("** Error - counter did not give the same properties back") counter.SetBounds(bounds[0], bounds[1]) *************** *** 389,395 **** num = num + 1 if num <> len(counter): ! raise error, "*** Length of counter and loop iterations dont match ***" if num <> 10: ! raise error, "*** Unexpected number of loop iterations ***" counter = counter._enum_.Clone() # Test Clone() and enum directly --- 389,395 ---- num = num + 1 if num <> len(counter): ! raise error("*** Length of counter and loop iterations dont match ***") if num <> 10: ! raise error("*** Unexpected number of loop iterations ***") counter = counter._enum_.Clone() # Test Clone() and enum directly *************** *** 399,403 **** num = num + 1 if num <> 10: ! raise error, "*** Unexpected number of loop iterations - got %d ***" % num progress("Finished testing counter") --- 399,403 ---- num = num + 1 if num <> 10: ! raise error("*** Unexpected number of loop iterations - got %d ***" % num) progress("Finished testing counter") Index: util.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/util.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** util.py 26 Nov 2008 01:27:40 -0000 1.12 --- util.py 26 Nov 2008 08:52:32 -0000 1.13 *************** *** 82,86 **** print "Registration command was:" print cmd ! raise RuntimeError, "Registration of engine '%s' failed" % filename def ExecuteShellCommand(cmd, testcase, --- 82,86 ---- print "Registration command was:" print cmd ! raise RuntimeError("Registration of engine '%s' failed" % filename) def ExecuteShellCommand(cmd, testcase, *************** *** 95,105 **** try: if rc: ! raise Failed, "exit code was " + str(rc) if expected_output is not None and output != expected_output: ! raise Failed, \ ! "Expected output %r (got %r)" % (expected_output, output) if not tracebacks_ok and \ output.find("Traceback (most recent call last)")>=0: ! raise Failed, "traceback in program output" return output except Failed, why: --- 95,104 ---- try: if rc: ! raise Failed("exit code was " + str(rc)) if expected_output is not None and output != expected_output: ! raise Failed("Expected output %r (got %r)" % (expected_output, output)) if not tracebacks_ok and \ output.find("Traceback (most recent call last)")>=0: ! raise Failed("traceback in program output") return output except Failed, why: Index: errorSemantics.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/errorSemantics.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** errorSemantics.py 26 Nov 2008 01:21:47 -0000 1.7 --- errorSemantics.py 26 Nov 2008 08:52:32 -0000 1.8 *************** *** 129,133 **** try: com_server.Commit(0) ! raise RuntimeError, "should have failed" except pythoncom.error: pass --- 129,133 ---- try: com_server.Commit(0) ! raise RuntimeError("should have failed") except pythoncom.error: pass *************** *** 138,142 **** try: com_server.Commit(0) ! raise RuntimeError, "should have failed" except pythoncom.error: pass --- 138,142 ---- try: com_server.Commit(0) ! raise RuntimeError("should have failed") except pythoncom.error: pass Index: testStreams.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testStreams.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** testStreams.py 31 Aug 2007 02:08:14 -0000 1.6 --- testStreams.py 26 Nov 2008 08:52:32 -0000 1.7 *************** *** 55,59 **** self.index = len(self.data)+dist else: ! raise ValueError, 'Unknown Seek type: ' +str(origin) if self.index < 0: self.index = 0 --- 55,59 ---- self.index = len(self.data)+dist else: ! raise ValueError('Unknown Seek type: ' +str(origin)) if self.index < 0: self.index = 0 Index: pippo_server.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/pippo_server.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pippo_server.py 3 Jun 2007 13:27:01 -0000 1.2 --- pippo_server.py 26 Nov 2008 08:52:32 -0000 1.3 *************** *** 46,50 **** rc = os.system ('midl "%s"' % (idl,)) if rc: ! raise RuntimeError, "Compiling MIDL failed!" # Can't work out how to prevent MIDL from generating the stubs. # just nuke them --- 46,50 ---- rc = os.system ('midl "%s"' % (idl,)) if rc: ! raise RuntimeError("Compiling MIDL failed!") # Can't work out how to prevent MIDL from generating the stubs. # just nuke them Index: testMSOffice.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testMSOffice.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** testMSOffice.py 26 Nov 2008 01:27:40 -0000 1.8 --- testMSOffice.py 26 Nov 2008 08:52:32 -0000 1.9 *************** *** 87,93 **** def TextExcel(xl): xl.Visible = 0 ! if xl.Visible: raise error, "Visible property is true." xl.Visible = 1 ! if not xl.Visible: raise error, "Visible property not true." if int(xl.Version[0])>=8: --- 87,93 ---- def TextExcel(xl): xl.Visible = 0 ! if xl.Visible: raise error("Visible property is true.") xl.Visible = 1 ! if not xl.Visible: raise error("Visible property not true.") if int(xl.Version[0])>=8: *************** *** 105,123 **** if xl.Range("A1").Value <> "Hi 0": ! raise error, "Single cell range failed" if xl.Range("A1:B1").Value <> ((Unicode("Hi 0"),2),): ! raise error, "flat-horizontal cell range failed" if xl.Range("A1:A2").Value <> ((Unicode("Hi 0"),),(Unicode("x"),)): ! raise error, "flat-vertical cell range failed" if xl.Range("A1:C3").Value <> ((Unicode("Hi 0"),2,3),(Unicode("x"),Unicode("Hi 1"),Unicode("z")),(3,2,Unicode("Hi 2"))): ! raise error, "square cell range failed" xl.Range("A1:C3").Value =((3,2,1),("x","y","z"),(1,2,3)) if xl.Range("A1:C3").Value <> ((3,2,1),(Unicode("x"),Unicode("y"),Unicode("z")),(1,2,3)): ! raise error, "Range was not what I set it to!" # test dates out with Excel --- 105,123 ---- if xl.Range("A1").Value <> "Hi 0": ! raise error("Single cell range failed") if xl.Range("A1:B1").Value <> ((Unicode("Hi 0"),2),): ! raise error("flat-horizontal cell range failed") if xl.Range("A1:A2").Value <> ((Unicode("Hi 0"),),(Unicode("x"),)): ! raise error("flat-vertical cell range failed") if xl.Range("A1:C3").Value <> ((Unicode("Hi 0"),2,3),(Unicode("x"),Unicode("Hi 1"),Unicode("z")),(3,2,Unicode("Hi 2"))): ! raise error("square cell range failed") xl.Range("A1:C3").Value =((3,2,1),("x","y","z"),(1,2,3)) if xl.Range("A1:C3").Value <> ((3,2,1),(Unicode("x"),Unicode("y"),Unicode("z")),(1,2,3)): ! raise error("Range was not what I set it to!") # test dates out with Excel Index: testGIT.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testGIT.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** testGIT.py 10 Jan 2006 04:04:00 -0000 1.1 --- testGIT.py 26 Nov 2008 08:52:32 -0000 1.2 *************** *** 29,40 **** def TestInterp(interp): if interp.Eval("1+1") <> 2: ! raise ValueError, "The interpreter returned the wrong result." try: interp.Eval(1+1) ! raise ValueError, "The interpreter did not raise an exception" except pythoncom.com_error, details: import winerror if details[0]!=winerror.DISP_E_TYPEMISMATCH: ! raise ValueError, "The interpreter exception was not winerror.DISP_E_TYPEMISMATCH." --- 29,40 ---- def TestInterp(interp): if interp.Eval("1+1") <> 2: ! raise ValueError("The interpreter returned the wrong result.") try: interp.Eval(1+1) ! raise ValueError("The interpreter did not raise an exception") except pythoncom.com_error, details: import winerror if details[0]!=winerror.DISP_E_TYPEMISMATCH: ! raise ValueError("The interpreter exception was not winerror.DISP_E_TYPEMISMATCH.") Index: testNetscape.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testNetscape.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testNetscape.py 18 Nov 2002 11:20:07 -0000 1.2 --- testNetscape.py 26 Nov 2008 08:52:32 -0000 1.3 *************** *** 11,15 **** n=netscape.CNetworkCX() rc = n.Open("http://d|/temp/apyext.html", 0, None, 0, None) ! if not rc: raise error, "Open method of Netscape failed" while 1: num, str = n.Read(None, 0) --- 11,15 ---- n=netscape.CNetworkCX() rc = n.Open("http://d|/temp/apyext.html", 0, None, 0, None) ! if not rc: raise error("Open method of Netscape failed") while 1: num, str = n.Read(None, 0) Index: testDynamic.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testDynamic.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testDynamic.py 18 Nov 2002 11:20:06 -0000 1.3 --- testDynamic.py 26 Nov 2008 08:52:32 -0000 1.4 *************** *** 53,62 **** client.ANewAttr = "Hello" if client.ANewAttr != "Hello": ! raise error, "Could not set dynamic property" v = ["Hello","From","Python",1.4] client.TestSequence = v if v != list(client.TestSequence): ! raise error, "Dynamic sequences not working! %r/%r" % (repr(v), repr(client.testSequence)) client.write("This","output","has","come","via","COM") --- 53,62 ---- client.ANewAttr = "Hello" if client.ANewAttr != "Hello": ! raise error("Could not set dynamic property") v = ["Hello","From","Python",1.4] client.TestSequence = v if v != list(client.TestSequence): ! raise error("Dynamic sequences not working! %r/%r" % (repr(v), repr(client.testSequence))) client.write("This","output","has","come","via","COM") *************** *** 64,68 **** client._FlagAsMethod("NotReallyAMethod") if not callable(client.NotReallyAMethod): ! raise error, "Method I flagged as callable isn't!" --- 64,68 ---- client._FlagAsMethod("NotReallyAMethod") if not callable(client.NotReallyAMethod): ! raise error("Method I flagged as callable isn't!") Index: testCollections.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testCollections.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** testCollections.py 10 Nov 2003 00:49:29 -0000 1.4 --- testCollections.py 26 Nov 2008 08:52:32 -0000 1.5 *************** *** 34,42 **** for i in range(len(check)): if o(i) != check[i]: ! raise error, "Using default method gave the incorrect value - %s/%s" % (`o(i)`, `check[i]`) for i in range(len(check)): if o.Item(i) != check[i]: ! raise error, "Using Item method gave the incorrect value - %s/%s" % (`o(i)`, `check[i]`) # First try looping. --- 34,42 ---- for i in range(len(check)): if o(i) != check[i]: ! raise error("Using default method gave the incorrect value - %s/%s" % (`o(i)`, `check[i]`)) for i in range(len(check)): if o.Item(i) != check[i]: ! raise error("Using Item method gave the incorrect value - %s/%s" % (`o(i)`, `check[i]`)) # First try looping. *************** *** 46,54 **** if cmp[:len(check)] != check: ! raise error, "Result after looping isnt correct - %s/%s" % (`cmp[:len(check)]`, `check`) for i in range(len(check)): if o[i] != check[i]: ! raise error, "Using indexing gave the incorrect value" --- 46,54 ---- if cmp[:len(check)] != check: ! raise error("Result after looping isnt correct - %s/%s" % (`cmp[:len(check)]`, `check`)) for i in range(len(check)): if o[i] != check[i]: ! raise error("Using indexing gave the incorrect value") *************** *** 91,113 **** try: o() ! raise error, "default method with no args worked when it shouldnt have!" except pythoncom.com_error, (hr, desc, exc, argErr): if hr != winerror.DISP_E_BADPARAMCOUNT: ! raise error, "Expected DISP_E_BADPARAMCOUNT - got %d (%s)" % (hr, desc) try: o.Insert("foo", 2) ! raise error, "Insert worked when it shouldnt have!" except pythoncom.com_error, (hr, desc, exc, argErr): if hr != winerror.DISP_E_TYPEMISMATCH: ! raise error, "Expected DISP_E_TYPEMISMATCH - got %d (%s)" % (hr, desc) # Remove the sublist for this test! try: o.Remove(o.Count()) ! raise error, "Remove worked when it shouldnt have!" except pythoncom.com_error, (hr, desc, exc, argErr): if hr != winerror.DISP_E_BADINDEX: ! raise error, "Expected DISP_E_BADINDEX - got %d (%s)" % (hr, desc) # Test an empty collection --- 91,113 ---- try: o() ! raise error("default method with no args worked when it shouldnt have!") except pythoncom.com_error, (hr, desc, exc, argErr): if hr != winerror.DISP_E_BADPARAMCOUNT: ! raise error("Expected DISP_E_BADPARAMCOUNT - got %d (%s)" % (hr, desc)) try: o.Insert("foo", 2) ! raise error("Insert worked when it shouldnt have!") except pythoncom.com_error, (hr, desc, exc, argErr): if hr != winerror.DISP_E_TYPEMISMATCH: ! raise error("Expected DISP_E_TYPEMISMATCH - got %d (%s)" % (hr, desc)) # Remove the sublist for this test! try: o.Remove(o.Count()) ! raise error("Remove worked when it shouldnt have!") except pythoncom.com_error, (hr, desc, exc, argErr): if hr != winerror.DISP_E_BADINDEX: ! raise error("Expected DISP_E_BADINDEX - got %d (%s)" % (hr, desc)) # Test an empty collection *************** *** 115,123 **** o = MakeEmptyEnum() for item in o: ! raise error, "Empty list performed an iteration" try: ob = o[1] ! raise error, "Empty list could be indexed" except IndexError: pass --- 115,123 ---- o = MakeEmptyEnum() for item in o: ! raise error("Empty list performed an iteration") try: ob = o[1] ! raise error("Empty list could be indexed") except IndexError: pass *************** *** 125,129 **** try: ob = o[0] ! raise error, "Empty list could be indexed" except IndexError: pass --- 125,129 ---- try: ob = o[0] ! raise error("Empty list could be indexed") except IndexError: pass *************** *** 131,138 **** try: ob = o(0) ! raise error, "Empty list could be indexed" except pythoncom.com_error, (hr, fn, desc, arg): if hr != winerror.DISP_E_BADINDEX: ! raise error, "Expected DISP_E_BADINDEX - got %d (%s)" % (hr, desc) class TestCase(win32com.test.util.TestCase): --- 131,138 ---- try: ob = o(0) ! raise error("Empty list could be indexed") except pythoncom.com_error, (hr, fn, desc, arg): if hr != winerror.DISP_E_BADINDEX: ! raise error("Expected DISP_E_BADINDEX - got %d (%s)" % (hr, desc)) class TestCase(win32com.test.util.TestCase): Index: testall.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testall.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** testall.py 26 Nov 2008 08:39:33 -0000 1.30 --- testall.py 26 Nov 2008 08:52:32 -0000 1.31 *************** *** 196,200 **** testLevel = int(arg) if testLevel < 0 or testLevel > 3: ! raise ValueError, "Only levels 1-3 are supported" except ValueError: test_names.append(arg) --- 196,200 ---- testLevel = int(arg) if testLevel < 0 or testLevel > 3: ! raise ValueError("Only levels 1-3 are supported") except ValueError: test_names.append(arg) Index: testExplorer.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testExplorer.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** testExplorer.py 26 Nov 2008 01:27:40 -0000 1.8 --- testExplorer.py 26 Nov 2008 08:52:32 -0000 1.9 *************** *** 27,31 **** iexplore.Visible = 1 if not bVisibleEventFired: ! raise RuntimeError, "The IE event did not appear to fire!" iexplore.Quit() iexplore = None --- 27,31 ---- iexplore.Visible = 1 if not bVisibleEventFired: ! raise RuntimeError("The IE event did not appear to fire!") iexplore.Quit() iexplore = None *************** *** 36,40 **** ie.Visible = 1 if not bVisibleEventFired: ! raise RuntimeError, "The IE event did not appear to fire!" ie.Quit() ie = None --- 36,40 ---- ie.Visible = 1 if not bVisibleEventFired: ! raise RuntimeError("The IE event did not appear to fire!") ie.Quit() ie = None Index: testDictionary.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testDictionary.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** testDictionary.py 26 Nov 2008 01:27:40 -0000 1.7 --- testDictionary.py 26 Nov 2008 08:52:32 -0000 1.8 *************** *** 20,24 **** for key, value in check.items(): if dict(key) != value: ! raise error, "Indexing for '%s' gave the incorrect value - %s/%s" % (`key`, `dict[key]`, `check[key]`) # Ensure we have the correct version registered. --- 20,24 ---- for key, value in check.items(): if dict(key) != value: ! raise error("Indexing for '%s' gave the incorrect value - %s/%s" % (`key`, `dict[key]`, `check[key]`)) # Ensure we have the correct version registered. *************** *** 50,71 **** try: dict() ! raise error, "default method with no args worked when it shouldnt have!" except pythoncom.com_error, (hr, desc, exc, argErr): if hr != winerror.DISP_E_BADPARAMCOUNT: ! raise error, "Expected DISP_E_BADPARAMCOUNT - got %d (%s)" % (hr, desc) try: dict("hi", "there") ! raise error, "multiple args worked when it shouldnt have!" except pythoncom.com_error, (hr, desc, exc, argErr): if hr != winerror.DISP_E_BADPARAMCOUNT: ! raise error, "Expected DISP_E_BADPARAMCOUNT - got %d (%s)" % (hr, desc) try: dict(0) ! raise error, "int key worked when it shouldnt have!" except pythoncom.com_error, (hr, desc, exc, argErr): if hr != winerror.DISP_E_TYPEMISMATCH: ! raise error, "Expected DISP_E_TYPEMISMATCH - got %d (%s)" % (hr, desc) if not quiet: --- 50,71 ---- try: dict() ! raise error("default method with no args worked when it shouldnt have!") except pythoncom.com_error, (hr, desc, exc, argErr): if hr != winerror.DISP_E_BADPARAMCOUNT: ! raise error("Expected DISP_E_BADPARAMCOUNT - got %d (%s)" % (hr, desc)) try: dict("hi", "there") ! raise error("multiple args worked when it shouldnt have!") except pythoncom.com_error, (hr, desc, exc, argErr): if hr != winerror.DISP_E_BADPARAMCOUNT: ! raise error("Expected DISP_E_BADPARAMCOUNT - got %d (%s)" % (hr, desc)) try: dict(0) ! raise error("int key worked when it shouldnt have!") except pythoncom.com_error, (hr, desc, exc, argErr): if hr != winerror.DISP_E_TYPEMISMATCH: ! raise error("Expected DISP_E_TYPEMISMATCH - got %d (%s)" % (hr, desc)) if not quiet: |
From: Mark H. <mha...@us...> - 2008-11-26 08:52:37
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/directsound/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19471/win32comext/directsound/test Modified Files: ds_test.py Log Message: modernize syntax: all remaining raise statements in com/* upgraded Index: ds_test.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/directsound/test/ds_test.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ds_test.py 14 Nov 2008 00:22:25 -0000 1.5 --- ds_test.py 26 Nov 2008 08:52:32 -0000 1.6 *************** *** 20,24 **** if riff != 'RIFF': ! raise ValueError, 'invalid wav header' if fmtsize != 16 or fmt != 'fmt ' or data != 'data': --- 20,24 ---- if riff != 'RIFF': ! raise ValueError('invalid wav header') if fmtsize != 16 or fmt != 'fmt ' or data != 'data': |
From: Mark H. <mha...@us...> - 2008-11-26 08:52:37
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19471/win32comext/shell/demos/servers Modified Files: shell_view.py Log Message: modernize syntax: all remaining raise statements in com/* upgraded Index: shell_view.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers/shell_view.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** shell_view.py 20 Jul 2008 03:16:25 -0000 1.12 --- shell_view.py 26 Nov 2008 08:52:33 -0000 1.13 *************** *** 134,138 **** klass = ShellFolderObject else: ! raise RuntimeError, "What is " + repr(typ) ret = wrap(klass(extra), iid, useDispatcher = (debug>0)) return ret --- 134,138 ---- klass = ShellFolderObject else: ! raise RuntimeError("What is " + repr(typ)) ret = wrap(klass(extra), iid, useDispatcher = (debug>0)) return ret *************** *** 735,739 **** break else: ! raise RuntimeError, "Can't find scintilla!" style = win32con.WS_CHILD | win32con.WS_VSCROLL | \ --- 735,739 ---- break else: ! raise RuntimeError("Can't find scintilla!") style = win32con.WS_CHILD | win32con.WS_VSCROLL | \ |
From: Mark H. <mha...@us...> - 2008-11-26 08:52:36
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/mapi/demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19471/win32comext/mapi/demos Modified Files: mapisend.py Log Message: modernize syntax: all remaining raise statements in com/* upgraded Index: mapisend.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/mapi/demos/mapisend.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mapisend.py 24 Sep 2004 04:03:52 -0000 1.2 --- mapisend.py 26 Nov 2008 08:52:32 -0000 1.3 *************** *** 45,49 **** #check for errors if mapitags.PROP_TYPE(tag) == mapitags.PT_ERROR: ! raise TypeError,'got PT_ERROR instead of PT_BINARY: %s'%eid outboxfolder = msgstore.OpenEntry(eid,None,mapi.MAPI_BEST_ACCESS) --- 45,49 ---- #check for errors if mapitags.PROP_TYPE(tag) == mapitags.PT_ERROR: ! raise TypeError('got PT_ERROR instead of PT_BINARY: %s'%eid) outboxfolder = msgstore.OpenEntry(eid,None,mapi.MAPI_BEST_ACCESS) |
From: Mark H. <mha...@us...> - 2008-11-26 08:52:36
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axscript/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19471/win32comext/axscript/test Modified Files: testHost.py Log Message: modernize syntax: all remaining raise statements in com/* upgraded Index: testHost.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/test/testHost.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** testHost.py 26 Nov 2008 01:14:40 -0000 1.6 --- testHost.py 26 Nov 2008 08:52:32 -0000 1.7 *************** *** 151,155 **** got_name = state_map.get(got, str(got)) state_name = state_map.get(state, str(state)) ! raise RuntimeError, "Warning - engine %s has state %s, but expected %s" % (name, got_name, state_name) class EngineTester(win32com.test.util.TestCase): --- 151,155 ---- got_name = state_map.get(got, str(got)) state_name = state_map.get(state, str(state)) ! raise RuntimeError("Warning - engine %s has state %s, but expected %s" % (name, got_name, state_name)) class EngineTester(win32com.test.util.TestCase): |
From: Mark H. <mha...@us...> - 2008-11-26 08:52:36
|
Update of /cvsroot/pywin32/pywin32/com/win32com/demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19471/win32com/demos Modified Files: connect.py excelRTDServer.py ietoolbar.py Log Message: modernize syntax: all remaining raise statements in com/* upgraded Index: ietoolbar.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/demos/ietoolbar.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ietoolbar.py 1 Oct 2008 09:40:26 -0000 1.2 --- ietoolbar.py 26 Nov 2008 08:52:32 -0000 1.3 *************** *** 76,80 **** def __setattr__(self, attr, val): if not attr.startswith("_") and not self.__dict__.has_key(attr): ! raise AttributeError, attr self.__dict__[attr] = val --- 76,80 ---- def __setattr__(self, attr, val): if not attr.startswith("_") and not self.__dict__.has_key(attr): ! raise AttributeError(attr) self.__dict__[attr] = val Index: connect.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/demos/connect.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** connect.py 26 Nov 2008 01:47:26 -0000 1.3 --- connect.py 26 Nov 2008 08:52:32 -0000 1.4 *************** *** 56,60 **** server.DoIt(val) if client.last_event_arg != val: ! raise RuntimeError, "Sent %r, but got back %r" % (val, client.last_event_arg) if verbose: print "Sent and received %r" % val --- 56,60 ---- server.DoIt(val) if client.last_event_arg != val: ! raise RuntimeError("Sent %r, but got back %r" % (val, client.last_event_arg)) if verbose: print "Sent and received %r" % val Index: excelRTDServer.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/demos/excelRTDServer.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** excelRTDServer.py 13 Feb 2005 12:08:29 -0000 1.1 --- excelRTDServer.py 26 Nov 2008 08:52:32 -0000 1.2 *************** *** 224,228 **** Will raise NotImplemented if not overridden. """ ! raise NotImplemented, 'Subclass must implement' # Overridable class events... --- 224,228 ---- Will raise NotImplemented if not overridden. """ ! raise NotImplemented('Subclass must implement') # Overridable class events... *************** *** 257,261 **** Gives us a chance to check if our topic data needs to be changed (eg. check a file, quiz a database, etc).""" ! raise NotImplemented, 'subclass must implement' def Reset(self): --- 257,261 ---- Gives us a chance to check if our topic data needs to be changed (eg. check a file, quiz a database, etc).""" ! raise NotImplemented('subclass must implement') def Reset(self): *************** *** 368,372 **** # topic value, but explosions like this should be able to get handled by # the VBA-side "On Error" stuff. ! raise ValueError, "Invalid topic strings: %s" % str(TopicStrings) #self.cmd = str(self.cmd) --- 368,372 ---- # topic value, but explosions like this should be able to get handled by # the VBA-side "On Error" stuff. ! raise ValueError("Invalid topic strings: %s" % str(TopicStrings)) #self.cmd = str(self.cmd) |
From: Mark H. <mha...@us...> - 2008-11-26 08:52:36
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/mapi In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19471/win32comext/mapi Modified Files: mapiutil.py Log Message: modernize syntax: all remaining raise statements in com/* upgraded Index: mapiutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/mapi/mapiutil.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mapiutil.py 2 Oct 2008 12:09:53 -0000 1.6 --- mapiutil.py 26 Nov 2008 08:52:32 -0000 1.7 *************** *** 121,125 **** type_tag = _MapiTypeMap.get(type(val)) if type_tag is None: ! raise ValueError, "Don't know what to do with '%r' ('%s')" % (val, type(val)) prop = mapitags.PROP_TAG( type_tag, mapitags.PROP_ID(propIds[0])) if val is None: --- 121,125 ---- type_tag = _MapiTypeMap.get(type(val)) if type_tag is None: ! raise ValueError("Don't know what to do with '%r' ('%s')" % (val, type(val))) prop = mapitags.PROP_TAG( type_tag, mapitags.PROP_ID(propIds[0])) if val is None: *************** *** 159,163 **** tagType = mapitags.PT_SYSTIME else: ! raise ValueError, "The type of object %s(%s) can not be written" % (`val`,type_val) key = mapitags.PROP_TAG(tagType, mapitags.PROP_ID(newIds[newIdNo])) newIdNo = newIdNo + 1 --- 159,163 ---- tagType = mapitags.PT_SYSTIME else: ! raise ValueError("The type of object %s(%s) can not be written" % (`val`,type_val)) key = mapitags.PROP_TAG(tagType, mapitags.PROP_ID(newIds[newIdNo])) newIdNo = newIdNo + 1 |
From: Mark H. <mha...@us...> - 2008-11-26 08:39:41
|
Update of /cvsroot/pywin32/pywin32/isapi In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18639/isapi Modified Files: install.py simple.py threaded_extension.py Log Message: various syntax modernizations Index: threaded_extension.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/threaded_extension.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** threaded_extension.py 17 Feb 2006 04:04:24 -0000 1.4 --- threaded_extension.py 26 Nov 2008 08:39:33 -0000 1.5 *************** *** 44,48 **** dispatcher = self.extension.dispatch_map.get(key) if dispatcher is None: ! raise RuntimeError, "Bad request '%s'" % (key,) dispatcher(errCode, bytes, key, overlapped) --- 44,48 ---- dispatcher = self.extension.dispatch_map.get(key) if dispatcher is None: ! raise RuntimeError("Bad request '%s'" % (key,)) dispatcher(errCode, bytes, key, overlapped) *************** *** 129,133 **** There is no default implementation - sub-classes must implement this. """ ! raise NotImplementedError, "sub-classes should override Dispatch" def HandleDispatchError(self, ecb): --- 129,133 ---- There is no default implementation - sub-classes must implement this. """ ! raise NotImplementedError("sub-classes should override Dispatch") def HandleDispatchError(self, ecb): Index: simple.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/simple.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** simple.py 17 Feb 2006 04:05:23 -0000 1.3 --- simple.py 26 Nov 2008 08:39:33 -0000 1.4 *************** *** 28,32 **** sub-classes must provide an implementation for this method. """ ! raise NotImplementedError, "sub-classes should override HttpExtensionProc" def TerminateExtension(self, status): --- 28,32 ---- sub-classes must provide an implementation for this method. """ ! raise NotImplementedError("sub-classes should override HttpExtensionProc") def TerminateExtension(self, status): *************** *** 50,54 **** """ if self.filter_flags is None: ! raise RuntimeError, "You must specify the filter flags" # nod to our reload capability - fv is None when we are reloaded. if fv is not None: --- 50,54 ---- """ if self.filter_flags is None: ! raise RuntimeError("You must specify the filter flags") # nod to our reload capability - fv is None when we are reloaded. if fv is not None: *************** *** 61,65 **** sub-classes must provide an implementation for this method. """ ! raise NotImplementedError, "sub-classes should override HttpExtensionProc" def TerminateFilter(self, status): --- 61,65 ---- sub-classes must provide an implementation for this method. """ ! raise NotImplementedError("sub-classes should override HttpExtensionProc") def TerminateFilter(self, status): Index: install.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/install.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** install.py 7 Mar 2007 01:47:39 -0000 1.11 --- install.py 26 Nov 2008 08:39:33 -0000 1.12 *************** *** 151,156 **** break else: ! raise ItemNotFound, \ ! "No web sites match the description '%s'" % (server_desc,) # Check it is good. try: --- 151,156 ---- break else: ! raise ItemNotFound( ! "No web sites match the description '%s'" % (server_desc,)) # Check it is good. try: *************** *** 160,165 **** if exc and exc[2]: msg = exc[2] ! raise ItemNotFound, \ ! "WebServer %s: %s" % (server, msg) return server --- 160,165 ---- if exc and exc[2]: msg = exc[2] ! raise ItemNotFound( ! "WebServer %s: %s" % (server, msg)) return server *************** *** 167,171 **** _CallHook(params, "PreInstall", options) if not params.Name: ! raise ConfigurationError, "No Name param" slash = params.Name.rfind("/") if slash >= 0: --- 167,171 ---- _CallHook(params, "PreInstall", options) if not params.Name: ! raise ConfigurationError("No Name param") slash = params.Name.rfind("/") if slash >= 0: *************** *** 238,243 **** newDir.ScriptMaps = (item,) + newDir.ScriptMaps else: ! raise ConfigurationError, \ ! "Unknown ScriptMapUpdate option '%s'" % (params.ScriptMapUpdate,) newDir.SetInfo() _CallHook(params, "PostInstall", options, newDir) --- 238,243 ---- newDir.ScriptMaps = (item,) + newDir.ScriptMaps else: ! raise ConfigurationError( ! "Unknown ScriptMapUpdate option '%s'" % (params.ScriptMapUpdate,)) newDir.SetInfo() _CallHook(params, "PostInstall", options, newDir) *************** *** 370,375 **** "PyISAPI_loader" + suffix + ".dll") if not os.path.isfile(template): ! raise ConfigurationError, \ ! "Template loader '%s' does not exist" % (template,) # We can't do a simple "is newer" check, as the DLL is specific to the # Python version. So we check the date-time and size are identical, --- 370,375 ---- "PyISAPI_loader" + suffix + ".dll") if not os.path.isfile(template): ! raise ConfigurationError( ! "Template loader '%s' does not exist" % (template,)) # We can't do a simple "is newer" check, as the DLL is specific to the # Python version. So we check the date-time and size are identical, *************** *** 450,454 **** if file_must_exist: if not os.path.isfile(dll_name): ! raise ConfigurationError, "%s does not exist" % (dll_name,) # Patch up all references to the DLL. --- 450,454 ---- if file_must_exist: if not os.path.isfile(dll_name): ! raise ConfigurationError("%s does not exist" % (dll_name,)) # Patch up all references to the DLL. *************** *** 488,492 **** conf_module_name = os.path.abspath(conf_module_name) if not os.path.isfile(conf_module_name): ! raise ConfigurationError, "%s does not exist" % (conf_module_name,) loader_dll = GetLoaderModuleName(conf_module_name) --- 488,492 ---- conf_module_name = os.path.abspath(conf_module_name) if not os.path.isfile(conf_module_name): ! raise ConfigurationError("%s does not exist" % (conf_module_name,)) loader_dll = GetLoaderModuleName(conf_module_name) |
From: Mark H. <mha...@us...> - 2008-11-26 08:39:38
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/ifilter In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18639/com/win32comext/ifilter Modified Files: ifiltercon.py Log Message: various syntax modernizations Index: ifiltercon.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/ifilter/ifiltercon.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ifiltercon.py 20 May 2005 23:22:59 -0000 1.2 --- ifiltercon.py 26 Nov 2008 08:39:33 -0000 1.3 *************** *** 27,31 **** CHUNK_EOC = 4 ! NOT_AN_ERROR = 0x00080000L FILTER_E_END_OF_CHUNKS = -2147215616 FILTER_E_NO_MORE_TEXT = -2147215615 --- 27,31 ---- CHUNK_EOC = 4 ! NOT_AN_ERROR = 0x00080000 FILTER_E_END_OF_CHUNKS = -2147215616 FILTER_E_NO_MORE_TEXT = -2147215615 |
From: Mark H. <mha...@us...> - 2008-11-26 08:39:38
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axdebug In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18639/com/win32comext/axdebug Modified Files: adb.py codecontainer.py documents.py util.py Log Message: various syntax modernizations Index: adb.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/adb.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** adb.py 8 Apr 2008 11:14:00 -0000 1.6 --- adb.py 26 Nov 2008 08:39:33 -0000 1.7 *************** *** 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) Index: util.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/util.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** util.py 18 Jun 2006 13:18:26 -0000 1.3 --- util.py 26 Nov 2008 08:39:33 -0000 1.4 *************** *** 112,114 **** import traceback traceback.print_exception(typ, val, tb) ! raise typ, val, tb --- 112,114 ---- import traceback traceback.print_exception(typ, val, tb) ! raise Index: documents.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/documents.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** documents.py 18 Jun 2006 13:18:26 -0000 1.2 --- documents.py 26 Nov 2008 08:39:33 -0000 1.3 *************** *** 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: codecontainer.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/codecontainer.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** codecontainer.py 18 Jun 2006 13:18:26 -0000 1.4 --- codecontainer.py 26 Nov 2008 08:39:33 -0000 1.5 *************** *** 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. |
From: Mark H. <mha...@us...> - 2008-11-26 08:39:38
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/mfc In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18639/Pythonwin/pywin/mfc Modified Files: dialog.py Log Message: various syntax modernizations Index: dialog.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/mfc/dialog.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** dialog.py 26 Nov 2008 01:30:11 -0000 1.6 --- dialog.py 26 Nov 2008 08:39:33 -0000 1.7 *************** *** 62,66 **** # Make a dialog object look like a dictionary for the DDX support def __nonzero__(self): ! return 1 def __len__(self): return len(self.data) def __getitem__(self, key): return self.data[key] --- 62,66 ---- # Make a dialog object look like a dictionary for the DDX support def __nonzero__(self): ! return True def __len__(self): return len(self.data) def __getitem__(self, key): return self.data[key] |
From: Mark H. <mha...@us...> - 2008-11-26 08:39:37
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18639/Pythonwin/pywin/scintilla Modified Files: document.py Log Message: various syntax modernizations Index: document.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/document.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** document.py 2 Sep 2008 19:52:33 -0000 1.7 --- document.py 26 Nov 2008 08:39:33 -0000 1.8 *************** *** 126,135 **** for view in self.GetAllViews(): func = getattr(view, funcName) ! apply(func, args) def _ApplyOptionalToViews(self, funcName, *args): for view in self.GetAllViews(): func = getattr(view, funcName, None) if func is not None: ! apply(func, args) def GetEditorView(self): # Find the first frame with a view, --- 126,135 ---- for view in self.GetAllViews(): func = getattr(view, funcName) ! func(*args) def _ApplyOptionalToViews(self, funcName, *args): for view in self.GetAllViews(): func = getattr(view, funcName, None) if func is not None: ! func(*args) def GetEditorView(self): # Find the first frame with a view, *************** *** 151,155 **** for v in self.doc.GetAllViews(): if v.GetSafeHwnd() == hwndFrom: ! return apply(getattr(v, self.name), (std, extra)) # Delegate to the document, but only from a single view (as each view sends it seperately) --- 151,155 ---- for v in self.doc.GetAllViews(): if v.GetSafeHwnd() == hwndFrom: ! return getattr(v, self.name)(*(std, extra)) # Delegate to the document, but only from a single view (as each view sends it seperately) *************** *** 161,163 **** (hwndFrom, idFrom, code) = std if hwndFrom == self.doc.GetEditorView().GetSafeHwnd(): ! apply(self.delegate, (std, extra)) --- 161,163 ---- (hwndFrom, idFrom, code) = std if hwndFrom == self.doc.GetEditorView().GetSafeHwnd(): ! self.delegate(*(std, extra)) |
From: Mark H. <mha...@us...> - 2008-11-26 08:39:37
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axscript/server In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18639/com/win32comext/axscript/server Modified Files: error.py Log Message: various syntax modernizations Index: error.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/server/error.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** error.py 1 Sep 1999 23:12:45 -0000 1.1 --- error.py 26 Nov 2008 08:39:33 -0000 1.2 *************** *** 12,18 **** self.activeScriptError = activeScriptError def __getattr__(self, attr): ! try: ! return getattr(self.activeScriptError, attr) ! except AttributeError: ! raise AttributeError, attr --- 12,15 ---- self.activeScriptError = activeScriptError def __getattr__(self, attr): ! return getattr(self.activeScriptError, attr) |
From: Mark H. <mha...@us...> - 2008-11-26 08:39:37
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18639/win32/Lib Modified Files: win32serviceutil.py win32timezone.py Log Message: various syntax modernizations Index: win32serviceutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32serviceutil.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** win32serviceutil.py 2 Oct 2008 12:09:53 -0000 1.27 --- win32serviceutil.py 26 Nov 2008 08:39:33 -0000 1.28 *************** *** 10,14 **** import sys, string, pywintypes, os ! error = "Python Service Utility Error" def LocatePythonServiceExe(exeName = None): --- 10,14 ---- import sys, string, pywintypes, os ! error = RuntimeError def LocatePythonServiceExe(exeName = None): *************** *** 32,38 **** if os.path.isfile(exeName): return exeName ! raise RuntimeError, "The executable '%s' is registered as the Python " \ ! "service exe, but it does not exist as specified" \ ! % exeName except win32api.error: # OK - not there - lets go a-searchin' --- 32,38 ---- if os.path.isfile(exeName): return exeName ! raise RuntimeError("The executable '%s' is registered as the Python " \ ! "service exe, but it does not exist as specified" \ ! % exeName) except win32api.error: # OK - not there - lets go a-searchin' *************** *** 46,50 **** except win32api.error: msg = "%s is not correctly registered\nPlease locate and run %s, and it will self-register\nThen run this service registration process again." % (exeName, exeName) ! raise error, msg def _GetServiceShortName(longName): --- 46,50 ---- except win32api.error: msg = "%s is not correctly registered\nPlease locate and run %s, and it will self-register\nThen run this service registration process again." % (exeName, exeName) ! raise error(msg) def _GetServiceShortName(longName): *************** *** 105,109 **** pass if not dllName: ! raise ValueError, "The name of the performance DLL must be available" dllName = win32api.GetFullPathName(dllName) # Now setup all the required "Performance" entries. --- 105,109 ---- pass if not dllName: ! raise ValueError("The name of the performance DLL must be available") dllName = win32api.GetFullPathName(dllName) # Now setup all the required "Performance" entries. *************** *** 349,353 **** win32api.Sleep(250) else: ! raise pywintypes.error, (winerror.ERROR_SERVICE_REQUEST_TIMEOUT, "QueryServiceStatus", win32api.FormatMessage(winerror.ERROR_SERVICE_REQUEST_TIMEOUT)[:-2]) def __StopServiceWithTimeout(hs, waitSecs = 30): --- 349,353 ---- win32api.Sleep(250) else: ! raise pywintypes.error(winerror.ERROR_SERVICE_REQUEST_TIMEOUT, "QueryServiceStatus", win32api.FormatMessage(winerror.ERROR_SERVICE_REQUEST_TIMEOUT)[:-2]) def __StopServiceWithTimeout(hs, waitSecs = 30): *************** *** 356,360 **** except pywintypes.error, (hr, name, msg): if hr!=winerror.ERROR_SERVICE_NOT_ACTIVE: ! raise win32service.error, (hr, name, msg) for i in range(waitSecs): status = win32service.QueryServiceStatus(hs) --- 356,360 ---- except pywintypes.error, (hr, name, msg): if hr!=winerror.ERROR_SERVICE_NOT_ACTIVE: ! raise win32service.error(hr, name, msg) for i in range(waitSecs): status = win32service.QueryServiceStatus(hs) *************** *** 363,367 **** win32api.Sleep(1000) else: ! raise pywintypes.error, (winerror.ERROR_SERVICE_REQUEST_TIMEOUT, "ControlService", win32api.FormatMessage(winerror.ERROR_SERVICE_REQUEST_TIMEOUT)[:-2]) --- 363,367 ---- win32api.Sleep(1000) else: ! raise pywintypes.error(winerror.ERROR_SERVICE_REQUEST_TIMEOUT, "ControlService", win32api.FormatMessage(winerror.ERROR_SERVICE_REQUEST_TIMEOUT)[:-2]) *************** *** 410,414 **** # Allow only "service not running" error if hr!=winerror.ERROR_SERVICE_NOT_ACTIVE: ! raise win32service.error, (hr, name, msg) # Give it a few goes, as the service may take time to stop for i in range(waitSeconds): --- 410,414 ---- # Allow only "service not running" error if hr!=winerror.ERROR_SERVICE_NOT_ACTIVE: ! raise win32service.error(hr, name, msg) # Give it a few goes, as the service may take time to stop for i in range(waitSeconds): *************** *** 467,471 **** fname = os.path.join(path, win32api.FindFiles(fname)[0][8]) except win32api.error: ! raise error, "Could not resolve the path name '%s' to a full path" % (argv[0]) modName = os.path.splitext(fname)[0] return modName + "." + cls.__name__ --- 467,471 ---- fname = os.path.join(path, win32api.FindFiles(fname)[0][8]) except win32api.error: ! raise error("Could not resolve the path name '%s' to a full path" % (argv[0])) modName = os.path.splitext(fname)[0] return modName + "." + cls.__name__ Index: win32timezone.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32timezone.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** win32timezone.py 10 Nov 2008 23:59:59 -0000 1.11 --- win32timezone.py 26 Nov 2008 08:39:33 -0000 1.12 *************** *** 234,238 **** key = _winreg.OpenKeyEx(_winreg.HKEY_LOCAL_MACHINE, tzRegKeyPath) except: ! raise ValueError, 'Timezone Name %s not found.' % timeZoneName return key --- 234,238 ---- key = _winreg.OpenKeyEx(_winreg.HKEY_LOCAL_MACHINE, tzRegKeyPath) except: ! raise ValueError('Timezone Name %s not found.' % timeZoneName) return key *************** *** 576,580 **** key = self._find_first_match_(sortedKeys, item) result = dict.__getitem__(self, key) ! if isinstance(result, RangeValueUndefined): raise KeyError, key return result --- 576,580 ---- key = self._find_first_match_(sortedKeys, item) result = dict.__getitem__(self, key) ! if isinstance(result, RangeValueUndefined): raise KeyError(key) return result |
From: Mark H. <mha...@us...> - 2008-11-26 08:39:37
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18639/com/win32com/test Modified Files: testall.py testvb.py Log Message: various syntax modernizations Index: testvb.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testvb.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** testvb.py 26 Nov 2008 01:27:40 -0000 1.21 --- testvb.py 26 Nov 2008 08:39:33 -0000 1.22 *************** *** 17,21 **** ## useDispatcher = win32com.server.dispatcher.DefaultDebugDispatcher ! error = "VB Test Error" # Set up a COM object that VB will do some callbacks on. This is used --- 17,21 ---- ## useDispatcher = win32com.server.dispatcher.DefaultDebugDispatcher ! error = RuntimeError # Set up a COM object that VB will do some callbacks on. This is used *************** *** 61,83 **** vbtest.LongProperty = -1 if vbtest.LongProperty != -1: ! raise error, "Could not set the long property correctly." vbtest.IntProperty = 10 if vbtest.IntProperty != 10: ! raise error, "Could not set the integer property correctly." vbtest.VariantProperty = 10 if vbtest.VariantProperty != 10: ! raise error, "Could not set the variant integer property correctly." vbtest.VariantProperty = buffer('raw\0data') if vbtest.VariantProperty != buffer('raw\0data'): ! raise error, "Could not set the variant buffer property correctly." vbtest.StringProperty = "Hello from Python" if vbtest.StringProperty != "Hello from Python": ! raise error, "Could not set the string property correctly." vbtest.VariantProperty = "Hello from Python" if vbtest.VariantProperty != "Hello from Python": ! raise error, "Could not set the variant string property correctly." vbtest.VariantProperty = (1.0, 2.0, 3.0) if vbtest.VariantProperty != (1.0, 2.0, 3.0): ! raise error, "Could not set the variant property to an array of floats correctly - '%s'." % (vbtest.VariantProperty,) TestArrays(vbtest, bUseGenerated) --- 61,83 ---- vbtest.LongProperty = -1 if vbtest.LongProperty != -1: ! raise error("Could not set the long property correctly.") vbtest.IntProperty = 10 if vbtest.IntProperty != 10: ! raise error("Could not set the integer property correctly.") vbtest.VariantProperty = 10 if vbtest.VariantProperty != 10: ! raise error("Could not set the variant integer property correctly.") vbtest.VariantProperty = buffer('raw\0data') if vbtest.VariantProperty != buffer('raw\0data'): ! raise error("Could not set the variant buffer property correctly.") vbtest.StringProperty = "Hello from Python" if vbtest.StringProperty != "Hello from Python": ! raise error("Could not set the string property correctly.") vbtest.VariantProperty = "Hello from Python" if vbtest.VariantProperty != "Hello from Python": ! raise error("Could not set the variant string property correctly.") vbtest.VariantProperty = (1.0, 2.0, 3.0) if vbtest.VariantProperty != (1.0, 2.0, 3.0): ! raise error("Could not set the variant property to an array of floats correctly - '%s'." % (vbtest.VariantProperty,)) TestArrays(vbtest, bUseGenerated) *************** *** 96,100 **** vbtest.VariantPutref = vbtest if vbtest.VariantPutref._oleobj_!= vbtest._oleobj_: ! raise error, "Could not set the VariantPutref property correctly." # Cant test further types for this VariantPutref, as only # COM objects can be stored ByRef. --- 96,100 ---- vbtest.VariantPutref = vbtest if vbtest.VariantPutref._oleobj_!= vbtest._oleobj_: ! raise error("Could not set the VariantPutref property correctly.") # Cant test further types for this VariantPutref, as only # COM objects can be stored ByRef. *************** *** 105,114 **** # vbtest.CollectionProperty = NewCollection((1,2,"3", "Four")) # if vbtest.CollectionProperty != (1,2,"3", "Four"): ! # raise error, "Could not set the Collection property correctly - got back " + str(vbtest.CollectionProperty) # These are sub's that have a single byref param # Result should be just the byref. if vbtest.IncrementIntegerParam(1) != 2: ! raise error, "Could not pass an integer byref" # Sigh - we cant have *both* "ommited byref" and optional args --- 105,114 ---- # vbtest.CollectionProperty = NewCollection((1,2,"3", "Four")) # if vbtest.CollectionProperty != (1,2,"3", "Four"): ! # raise error("Could not set the Collection property correctly - got back " + str(vbtest.CollectionProperty)) # These are sub's that have a single byref param # Result should be just the byref. if vbtest.IncrementIntegerParam(1) != 2: ! raise error("Could not pass an integer byref") # Sigh - we cant have *both* "ommited byref" and optional args *************** *** 116,126 **** # rather than simply all byrefs working as optional. # if vbtest.IncrementIntegerParam() != 1: ! # raise error, "Could not pass an omitted integer byref" if vbtest.IncrementVariantParam(1) != 2: ! raise error, "Could not pass an int VARIANT byref:"+str(vbtest.IncrementVariantParam(1)) if vbtest.IncrementVariantParam(1.5) != 2.5: ! raise error, "Could not pass a float VARIANT byref" # Can't test IncrementVariantParam with the param omitted as it --- 116,126 ---- # rather than simply all byrefs working as optional. # if vbtest.IncrementIntegerParam() != 1: ! # raise error("Could not pass an omitted integer byref") if vbtest.IncrementVariantParam(1) != 2: ! raise error("Could not pass an int VARIANT byref:"+str(vbtest.IncrementVariantParam(1))) if vbtest.IncrementVariantParam(1.5) != 2.5: ! raise error("Could not pass a float VARIANT byref") # Can't test IncrementVariantParam with the param omitted as it *************** *** 131,135 **** ret = vbtest.PassIntByVal(1) if ret != 2: ! raise error, "Could not increment the integer - "+str(ret) TestVBInterface(vbtest) --- 131,135 ---- ret = vbtest.PassIntByVal(1) if ret != 2: ! raise error("Could not increment the integer - "+str(ret)) TestVBInterface(vbtest) *************** *** 140,149 **** ret = vbtest.PassIntByRef(1) if ret != (1,2): ! raise error, "Could not increment the integer - "+str(ret) # Check you can leave a byref arg blank. # see above # ret = vbtest.PassIntByRef() # if ret != (0,1): ! # raise error, "Could not increment the integer with default arg- "+str(ret) def _DoTestCollection(vbtest, col_name, expected): --- 140,149 ---- ret = vbtest.PassIntByRef(1) if ret != (1,2): ! raise error("Could not increment the integer - "+str(ret)) # Check you can leave a byref arg blank. # see above # ret = vbtest.PassIntByRef() # if ret != (0,1): ! # raise error("Could not increment the integer with default arg- "+str(ret)) def _DoTestCollection(vbtest, col_name, expected): *************** *** 159,163 **** check.append(item) if check != list(expected): ! raise error, "Collection %s didn't have %r (had %r)" % (col_name, expected, check) # Just looping over the collection again works (ie, is restartable) check = [] --- 159,163 ---- check.append(item) if check != list(expected): ! raise error("Collection %s didn't have %r (had %r)" % (col_name, expected, check)) # Just looping over the collection again works (ie, is restartable) check = [] *************** *** 165,169 **** check.append(item) if check != list(expected): ! raise error, "Collection 2nd time around %s didn't have %r (had %r)" % (col_name, expected, check) # Check we can get it via iter() i = iter(getattr(vbtest, col_name)) --- 165,169 ---- check.append(item) if check != list(expected): ! raise error("Collection 2nd time around %s didn't have %r (had %r)" % (col_name, expected, check)) # Check we can get it via iter() i = iter(getattr(vbtest, col_name)) *************** *** 172,176 **** check.append(item) if check != list(expected): ! raise error, "Collection iterator %s didn't have %r 2nd time around (had %r)" % (col_name, expected, check) # but an iterator is not restartable check = [] --- 172,176 ---- check.append(item) if check != list(expected): ! raise error("Collection iterator %s didn't have %r 2nd time around (had %r)" % (col_name, expected, check)) # but an iterator is not restartable check = [] *************** *** 178,187 **** check.append(item) if check != []: ! raise error, "2nd time around Collection iterator %s wasn't empty (had %r)" % (col_name, check) # Check len()==Count() c = getattr(vbtest, col_name) if len(c) != _getcount(c): ! raise error, "Collection %s __len__(%r) wasn't==Count(%r)" % (col_name, len(c), _getcount(c)) # Check we can do it with zero based indexing. c = getattr(vbtest, col_name) --- 178,187 ---- check.append(item) if check != []: ! raise error("2nd time around Collection iterator %s wasn't empty (had %r)" % (col_name, check)) # Check len()==Count() c = getattr(vbtest, col_name) if len(c) != _getcount(c): ! raise error("Collection %s __len__(%r) wasn't==Count(%r)" % (col_name, len(c), _getcount(c))) # Check we can do it with zero based indexing. c = getattr(vbtest, col_name) *************** *** 190,194 **** check.append(c[i]) if check != list(expected): ! raise error, "Collection %s didn't have %r (had %r)" % (col_name, expected, check) # Check we can do it with our old "Skip/Next" methods. --- 190,194 ---- check.append(c[i]) if check != list(expected): ! raise error("Collection %s didn't have %r (had %r)" % (col_name, expected, check)) # Check we can do it with our old "Skip/Next" methods. *************** *** 201,205 **** check.append(n[0]) if check != list(expected): ! raise error, "Collection %s didn't have %r (had %r)" % (col_name, expected, check) def TestCollections(vbtest): --- 201,205 ---- check.append(n[0]) if check != list(expected): ! raise error("Collection %s didn't have %r (had %r)" % (col_name, expected, check)) def TestCollections(vbtest): *************** *** 207,211 **** # zero based indexing works for simple VB collections. if vbtest.CollectionProperty[0] != 1: ! raise error, "The CollectionProperty[0] element was not the default value" _DoTestCollection(vbtest, "EnumerableCollectionProperty", []) --- 207,211 ---- # zero based indexing works for simple VB collections. if vbtest.CollectionProperty[0] != 1: ! raise error("The CollectionProperty[0] element was not the default value") _DoTestCollection(vbtest, "EnumerableCollectionProperty", []) *************** *** 219,230 **** vbtest.ArrayProperty = data if expected_exception is not None: ! raise error, "Expected '%s'" % expected_exception except expected_exception: return got = vbtest.ArrayProperty if got != data: ! raise error, \ ! "Could not set the array data correctly - got %r, expected %r" \ ! % (got, data) def TestArrays(vbtest, bUseGenerated): --- 219,230 ---- vbtest.ArrayProperty = data if expected_exception is not None: ! raise error("Expected '%s'" % expected_exception) except expected_exception: return got = vbtest.ArrayProperty if got != data: ! raise error( ! "Could not set the array data correctly - got %r, expected %r" ! % (got, data)) def TestArrays(vbtest, bUseGenerated): *************** *** 297,303 **** byRefParam = map(str, byRefParam) if testData != list(resultData): ! raise error, "The safe array data was not what we expected - got " + str(resultData) if testData != list(byRefParam): ! raise error, "The safe array data was not what we expected - got " + str(byRefParam) testData = [1.0, 2.0, 3.0] resultData, byRefParam = vbtest.PassSAFEARRAYVariant(testData) --- 297,303 ---- byRefParam = map(str, byRefParam) if testData != list(resultData): ! raise error("The safe array data was not what we expected - got " + str(resultData)) if testData != list(byRefParam): ! raise error("The safe array data was not what we expected - got " + str(byRefParam)) testData = [1.0, 2.0, 3.0] resultData, byRefParam = vbtest.PassSAFEARRAYVariant(testData) *************** *** 319,350 **** try: vbtest.IntProperty = "One" ! raise error, "Should have failed by now" except pythoncom.com_error, (hr, desc, exc, argErr): if hr != winerror.DISP_E_TYPEMISMATCH: ! raise error, "Expected DISP_E_TYPEMISMATCH" s = vbtest.StructProperty if s.int_val != 99 or str(s.str_val) != "hello": ! raise error, "The struct value was not correct" s.str_val = "Hi from Python" s.int_val = 11 if s.int_val != 11 or str(s.str_val) != "Hi from Python": ! raise error, "The struct value didnt persist!" if s.sub_val.int_val != 66 or str(s.sub_val.str_val) != "sub hello": ! raise error, "The sub-struct value was not correct" sub = s.sub_val sub.int_val = 22 if sub.int_val != 22: print sub.int_val ! raise error, "The sub-struct value didnt persist!" if s.sub_val.int_val != 22: print s.sub_val.int_val ! raise error, "The sub-struct value (re-fetched) didnt persist!" if s.sub_val.array_val[0].int_val != 0 or str(s.sub_val.array_val[0].str_val) != "zero": print s.sub_val.array_val[0].int_val ! raise error, "The array element wasnt correct" s.sub_val.array_val[0].int_val = 99 s.sub_val.array_val[1].int_val = 66 --- 319,350 ---- try: vbtest.IntProperty = "One" ! raise error("Should have failed by now") except pythoncom.com_error, (hr, desc, exc, argErr): if hr != winerror.DISP_E_TYPEMISMATCH: ! raise error("Expected DISP_E_TYPEMISMATCH") s = vbtest.StructProperty if s.int_val != 99 or str(s.str_val) != "hello": ! raise error("The struct value was not correct") s.str_val = "Hi from Python" s.int_val = 11 if s.int_val != 11 or str(s.str_val) != "Hi from Python": ! raise error("The struct value didnt persist!") if s.sub_val.int_val != 66 or str(s.sub_val.str_val) != "sub hello": ! raise error("The sub-struct value was not correct") sub = s.sub_val sub.int_val = 22 if sub.int_val != 22: print sub.int_val ! raise error("The sub-struct value didnt persist!") if s.sub_val.int_val != 22: print s.sub_val.int_val ! raise error("The sub-struct value (re-fetched) didnt persist!") if s.sub_val.array_val[0].int_val != 0 or str(s.sub_val.array_val[0].str_val) != "zero": print s.sub_val.array_val[0].int_val ! raise error("The array element wasnt correct") s.sub_val.array_val[0].int_val = 99 s.sub_val.array_val[1].int_val = 66 *************** *** 352,356 **** s.sub_val.array_val[1].int_val != 66: print s.sub_val.array_val[0].int_val ! raise error, "The array element didnt persist." # Now pass the struct back to VB vbtest.StructProperty = s --- 352,356 ---- s.sub_val.array_val[1].int_val != 66: print s.sub_val.array_val[0].int_val ! raise error("The array element didnt persist.") # Now pass the struct back to VB vbtest.StructProperty = s *************** *** 358,364 **** s = vbtest.StructProperty if s.int_val != 11 or str(s.str_val) != "Hi from Python": ! raise error, "After sending to VB, the struct value didnt persist!" if s.sub_val.array_val[0].int_val != 99: ! raise error, "After sending to VB, the struct array value didnt persist!" # Now do some object equality tests. --- 358,364 ---- s = vbtest.StructProperty if s.int_val != 11 or str(s.str_val) != "Hi from Python": ! raise error("After sending to VB, the struct value didnt persist!") if s.sub_val.array_val[0].int_val != 99: ! raise error("After sending to VB, the struct array value didnt persist!") # Now do some object equality tests. *************** *** 398,402 **** try: s.bad_attribute ! raise RuntimeError, "Could get a bad attribute" except AttributeError: pass --- 398,402 ---- try: s.bad_attribute ! raise RuntimeError("Could get a bad attribute") except AttributeError: pass *************** *** 410,417 **** t = ob.GetInterfaceTester(2) if t.getn() != 2: ! raise error, "Initial value wrong" t.setn(3) if t.getn() != 3: ! raise error, "New value wrong" def DoTestAll(): --- 410,417 ---- t = ob.GetInterfaceTester(2) if t.getn() != 2: ! raise error("Initial value wrong") t.setn(3) if t.getn() != 3: ! raise error("New value wrong") def DoTestAll(): *************** *** 428,432 **** if not __debug__: ! raise RuntimeError, "This must be run in debug mode - we use assert!" try: DoTestAll() --- 428,432 ---- if not __debug__: ! raise RuntimeError("This must be run in debug mode - we use assert!") try: DoTestAll() Index: testall.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testall.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** testall.py 26 Nov 2008 01:27:40 -0000 1.29 --- testall.py 26 Nov 2008 08:39:33 -0000 1.30 *************** *** 2,8 **** import pythoncom import win32com.client ! from win32com.test.util import (CheckClean, TestCase, ! CapturingFunctionTestCase, ShellTestCase, ! TestLoader, TestRunner, RegisterPythonServer) import traceback import getopt --- 2,8 ---- import pythoncom import win32com.client ! from win32com.test.util import CheckClean, TestCase, \ ! CapturingFunctionTestCase, ShellTestCase, \ ! TestLoader, TestRunner, RegisterPythonServer import traceback import getopt |
From: Mark H. <mha...@us...> - 2008-11-26 08:39:37
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18639/com/win32comext/shell/src Modified Files: PyIShellLink.cpp Log Message: various syntax modernizations Index: PyIShellLink.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellLink.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PyIShellLink.cpp 3 Jun 2007 14:53:07 -0000 1.9 --- PyIShellLink.cpp 26 Nov 2008 08:39:33 -0000 1.10 *************** *** 61,67 **** return OleSetOleError(hr); } ! PyObject *obFD = PyObject_FromWIN32_FIND_DATAA(&fd); ! PyObject *obFile = PyWinObject_FromTCHAR(pszFile); ! PyObject *ret = Py_BuildValue("NN", obFile, obFD); free(pszFile); return ret; --- 61,67 ---- return OleSetOleError(hr); } ! PyObject *ret = Py_BuildValue("NN", ! PyWinObject_FromTCHAR(pszFile), ! PyObject_FromWIN32_FIND_DATA(&fd)); free(pszFile); return ret; |
From: Mark H. <mha...@us...> - 2008-11-26 08:39:37
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18639/com/win32com/client Modified Files: __init__.py Log Message: various syntax modernizations Index: __init__.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/__init__.py,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** __init__.py 14 Nov 2008 00:22:25 -0000 1.36 --- __init__.py 26 Nov 2008 08:39:33 -0000 1.37 *************** *** 11,15 **** import pythoncom ! import dynamic, gencache import sys import pywintypes --- 11,16 ---- import pythoncom ! import dynamic ! import gencache import sys import pywintypes *************** *** 258,266 **** clsid = disp_class.CLSID # Create a new class that derives from 3 classes - the dispatch class, the event sink class and the user class. ! import new events_class = getevents(clsid) if events_class is None: raise ValueError("This COM object does not support events.") ! result_class = new.classobj("COMEventClass", (disp_class, events_class, user_event_class), {"__setattr__" : _event_setattr_}) instance = result_class(disp._oleobj_) # This only calls the first base class __init__. events_class.__init__(instance, instance) --- 259,272 ---- clsid = disp_class.CLSID # Create a new class that derives from 3 classes - the dispatch class, the event sink class and the user class. ! # XXX - we are still "classic style" classes in py2x, so we need can't yet ! # use 'type()' everywhere - revisit soon, as py2x will move to new-style too... ! try: ! from types import ClassType as new_type ! except ImportError: ! new_type = type # py3k events_class = getevents(clsid) if events_class is None: raise ValueError("This COM object does not support events.") ! result_class = new_type("COMEventClass", (disp_class, events_class, user_event_class), {"__setattr__" : _event_setattr_}) instance = result_class(disp._oleobj_) # This only calls the first base class __init__. events_class.__init__(instance, instance) |
From: Mark H. <mha...@us...> - 2008-11-26 08:39:37
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18639/Pythonwin/pywin/tools Modified Files: hierlist.py Log Message: various syntax modernizations Index: hierlist.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools/hierlist.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** hierlist.py 14 Nov 2008 00:22:25 -0000 1.9 --- hierlist.py 26 Nov 2008 08:39:33 -0000 1.10 *************** *** 57,63 **** self.bitmapMask = bitmapMask def __getattr__(self, attr): ! l = self.__dict__['listControl'] ! if l is not None: ! return getattr(l, attr) def ItemFromHandle(self, handle): return self.itemHandleMap[handle] --- 57,65 ---- self.bitmapMask = bitmapMask def __getattr__(self, attr): ! try: ! return getattr(self.listControl, attr) ! except AttributeError: ! return getattr(self, attr) ! def ItemFromHandle(self, handle): return self.itemHandleMap[handle] |