Update of /cvsroot/pywin32/pywin32/com/win32com/makegw
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20331/com/win32com/makegw
Modified Files:
Tag: py3k
makegw.py makegwparse.py
Log Message:
many more upgrades to py3k syntax
Index: makegw.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/makegw/makegw.py,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -C2 -d -r1.9 -r1.9.2.1
*** makegw.py 25 Apr 2007 03:32:05 -0000 1.9
--- makegw.py 26 Nov 2008 09:03:29 -0000 1.9.2.1
***************
*** 207,211 ****
codeCobjects = codeCobjects + "\t%s;\n" % (comArgDeclString)
argsCOM = argsCOM + ", " + comArgName
! except makegwparse.error_not_supported, why:
f.write('// *** The input argument %s of type "%s" was not processed ***\n// Please check the conversion function is appropriate and exists!\n' % (arg.name, arg.raw_type))
--- 207,211 ----
codeCobjects = codeCobjects + "\t%s;\n" % (comArgDeclString)
argsCOM = argsCOM + ", " + comArgName
! except makegwparse.error_not_supported as why:
f.write('// *** The input argument %s of type "%s" was not processed ***\n// Please check the conversion function is appropriate and exists!\n' % (arg.name, arg.raw_type))
***************
*** 254,258 ****
codeVarsPass = codeVarsPass + ", " + argCvt.GetBuildValueArg()
codeDecl = codeDecl + argCvt.DeclareParseArgTupleInputConverter()
! except makegwparse.error_not_supported, why:
f.write('// *** The output argument %s of type "%s" was not processed ***\n// %s\n' % (arg.name, arg.raw_type, why))
continue
--- 254,258 ----
codeVarsPass = codeVarsPass + ", " + argCvt.GetBuildValueArg()
codeDecl = codeDecl + argCvt.DeclareParseArgTupleInputConverter()
! except makegwparse.error_not_supported as why:
f.write('// *** The output argument %s of type "%s" was not processed ***\n// %s\n' % (arg.name, arg.raw_type, why))
continue
***************
*** 387,391 ****
codePre = codePre + argCvt.GetBuildForGatewayPreCode()
codePost = codePost + argCvt.GetBuildForGatewayPostCode()
! except makegwparse.error_not_supported, why:
f.write('// *** The input argument %s of type "%s" was not processed ***\n// - Please ensure this conversion function exists, and is appropriate\n// - %s\n' % (arg.name, arg.raw_type, why))
f.write('\tPyObject *ob%s = PyObject_From%s(%s);\n' % (arg.name, arg.type, arg.name))
--- 387,391 ----
codePre = codePre + argCvt.GetBuildForGatewayPreCode()
codePost = codePost + argCvt.GetBuildForGatewayPostCode()
! except makegwparse.error_not_supported as why:
f.write('// *** The input argument %s of type "%s" was not processed ***\n// - Please ensure this conversion function exists, and is appropriate\n// - %s\n' % (arg.name, arg.raw_type, why))
f.write('\tPyObject *ob%s = PyObject_From%s(%s);\n' % (arg.name, arg.type, arg.name))
***************
*** 430,434 ****
codePost = codePost + argCvt.GetParsePostCode()
needConversion = needConversion or argCvt.NeedUSES_CONVERSION()
! except makegwparse.error_not_supported, why:
f.write('// *** The output argument %s of type "%s" was not processed ***\n// %s\n' % (arg.name, arg.raw_type, why))
--- 430,434 ----
codePost = codePost + argCvt.GetParsePostCode()
needConversion = needConversion or argCvt.NeedUSES_CONVERSION()
! except makegwparse.error_not_supported as why:
f.write('// *** The output argument %s of type "%s" was not processed ***\n// %s\n' % (arg.name, arg.raw_type, why))
Index: makegwparse.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/makegw/makegwparse.py,v
retrieving revision 1.13
retrieving revision 1.13.2.1
diff -C2 -d -r1.13 -r1.13.2.1
*** makegwparse.py 27 Jul 2008 06:44:59 -0000 1.13
--- makegwparse.py 26 Nov 2008 09:03:29 -0000 1.13.2.1
***************
*** 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
***************
*** 126,130 ****
def _GetDeclaredIndirection(self):
return self.arg.indirectionLevel
! print 'declared:', self.arg.name, self.gatewayMode
if self.gatewayMode:
return self.arg.indirectionLevel
--- 126,130 ----
def _GetDeclaredIndirection(self):
return self.arg.indirectionLevel
! print('declared:', self.arg.name, self.gatewayMode)
if self.gatewayMode:
return 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))
***************
*** 647,651 ****
if VERBOSE:
! print " Arg %s of type %s%s (%s)" % (self.name, self.type, "*" * self.indirectionLevel, self.inout)
def HasAttribute(self, typ):
--- 647,651 ----
if VERBOSE:
! print(" Arg %s of type %s%s (%s)" % (self.name, self.type, "*" * self.indirectionLevel, self.inout))
def HasAttribute(self, typ):
***************
*** 692,700 ****
if self.result != "HRESULT":
if self.result=="DWORD": # DWORD is for old old stuff?
! print "Warning: Old style interface detected - compilation errors likely!"
else:
! print "Method %s - Only HRESULT return types are supported." % self.name
# raise error_not_supported, if VERBOSE:
! print " Method %s %s(" % (self.result, self.name)
while 1:
arg = Argument(self.good_interface_names)
--- 692,700 ----
if self.result != "HRESULT":
if self.result=="DWORD": # DWORD is for old old stuff?
! print("Warning: Old style interface detected - compilation errors likely!")
else:
! print("Method %s - Only HRESULT return types are supported." % self.name)
# raise error_not_supported, if VERBOSE:
! print(" Method %s %s(" % (self.result, self.name))
while 1:
arg = Argument(self.good_interface_names)
***************
*** 719,723 ****
self.base = mo.group(3)
if VERBOSE:
! print "Interface %s : public %s" % (self.name, self.base)
def BuildMethods(self, file):
--- 719,723 ----
self.base = mo.group(3)
if VERBOSE:
! print("Interface %s : public %s" % (self.name, self.base))
def BuildMethods(self, file):
***************
*** 747,751 ****
if mo:
name = mo.group(2)
! print name
AllConverters[name] = (ArgFormatterInterface, 0, 1)
if name==interfaceName:
--- 747,751 ----
if mo:
name = mo.group(2)
! print(name)
AllConverters[name] = (ArgFormatterInterface, 0, 1)
if name==interfaceName:
***************
*** 769,773 ****
except re.error:
traceback.print_exc()
! print "The interface could not be built, as the regular expression failed!"
def test():
f=open("d:\\msdev\\include\\objidl.h")
--- 769,773 ----
except re.error:
traceback.print_exc()
! print("The interface could not be built, as the regular expression failed!")
def test():
f=open("d:\\msdev\\include\\objidl.h")
***************
*** 780,784 ****
res=r.search(text,0)
if res==-1:
! print "** Not found"
else:
! print "%d\n%s\n%s\n%s\n%s" % (res, r.group(1), r.group(2), r.group(3), r.group(4))
--- 780,784 ----
res=r.search(text,0)
if res==-1:
! print("** Not found")
else:
! print("%d\n%s\n%s\n%s\n%s" % (res, r.group(1), r.group(2), r.group(3), r.group(4)))
|