diff --git a/classRepresentation/methodGiws.py b/classRepresentation/methodGiws.py index 9201029..22a097f 100644 --- a/classRepresentation/methodGiws.py +++ b/classRepresentation/methodGiws.py @@ -94,7 +94,7 @@ def getParametersCXX(self): # needed to lenRow if ( self.getReturn().isArray() - and configGiws().getDisableReturnSize() != True + and configGiws().getDisableReturnSize() is not True ): str += ", " @@ -129,8 +129,7 @@ def __createMethodBody(self): arrayOfStringDeclared = True if ( - paramType.specificPreProcessing(parameter, self.getDetachThread()) - != None + paramType.specificPreProcessing(parameter, self.getDetachThread()) is not None ): str += paramType.specificPreProcessing( parameter, self.getDetachThread() @@ -216,7 +215,7 @@ def generateCXXHeader(self): static = "" ret = "" - if self.getReturn().isArray() and configGiws().getDisableReturnSize() != True: + if self.getReturn().isArray() and configGiws().getDisableReturnSize() is not True: if len(self.__parameters) != 0: ret += ", " if self.getReturn().getDimensionArray() == 1: @@ -243,7 +242,7 @@ def generateCXXBody(self, className): ) ret = "" - if self.getReturn().isArray() and configGiws().getDisableReturnSize() != True: + if self.getReturn().isArray() and configGiws().getDisableReturnSize() is not True: if len(self.__parameters) != 0: ret += ", " if self.getReturn().getDimensionArray() == 1: diff --git a/classRepresentation/objectGiws.py b/classRepresentation/objectGiws.py index 250e4fe..2af7d20 100644 --- a/classRepresentation/objectGiws.py +++ b/classRepresentation/objectGiws.py @@ -83,8 +83,8 @@ def __getDeclarationOfCachingMethodID(self): # Avoids to load the class String each time we need it if ( isinstance(param.getType(), stringDataGiws) - and param.getType().isArray() == True - and stringClassSet != True + and param.getType().isArray() is True + and stringClassSet is not True and method.getModifier() != "static" ): str += """ @@ -94,7 +94,7 @@ def __getDeclarationOfCachingMethodID(self): """ stringClassSet = True - if self.getExtendedClass() != None: + if self.getExtendedClass() is not None: # Get the father object to work on it. str += self.getExtendedClass().__getDeclarationOfCachingMethodID() @@ -165,7 +165,7 @@ def __getConstructorWhichInstanciateTheNewObject(self): self.getName(), self.__getConstructorProfileWhichInstanciateTheNewObject(), ) - if self.getExtendedClass() != None: + if self.getExtendedClass() is not None: constructorProfile += """ : %s(fakeGiwsDataType::fakeGiwsDataType())""" % ( self.getExtendedClass().getName() ) @@ -260,7 +260,7 @@ def __getConstructorWhichUsesAnAlreadyExistingJObject(self): self.getName(), self.__getConstructorProfileWhichUsesAnAlreadyExistingJObject(), ) - if self.getExtendedClass() != None: + if self.getExtendedClass() is not None: constructorProfile += """ : %s(fakeGiwsDataType::fakeGiwsDataType()) """ % ( self.getExtendedClass().getName() ) @@ -330,7 +330,7 @@ def getConstructorWhichInstanciateTheNewObjectHeaderCXX(self): def __getFakeConstructorForExtendedClasses(self): str = "" - if self.getExtendedClass() == None: + if self.getExtendedClass() is None: # It is a potential master class, add the fake constructor str += """ /** @@ -359,8 +359,8 @@ def getMethodsProfileForMethodIdCache(self): # Avoids to load the class String each time we need it if ( isinstance(param.getType(), stringDataGiws) - and param.getType().isArray() == True - and stringClassSet != True + and param.getType().isArray() is True + and stringClassSet is not True ): str += """jclass stringArrayClass; """ @@ -370,7 +370,7 @@ def getMethodsProfileForMethodIdCache(self): def getProtectedFields(self): str = "" - if self.getExtendedClass() == None: + if self.getExtendedClass() is None: str += """ jobject instance; jclass instanceClass; // cache class @@ -395,7 +395,7 @@ def getMethodsCXX(self, type="header"): def generateCXXHeader(self, packageName): JNIObjectName = packageName + "/" + self.getName() - if self.getExtendedClass() == None: + if self.getExtendedClass() is None: classProfile = """class GIWSEXPORT %s {""" % (self.getName()) else: classProfile = """class GIWSEXPORT %s : public %s { @@ -548,7 +548,7 @@ def needCaching(self): for method in self.__methods: for param in method.getParameters(): - if param.getType().isByteBufferBased() == True: + if param.getType().isByteBufferBased() is True: return True return False diff --git a/classRepresentation/parameterGiws.py b/classRepresentation/parameterGiws.py index c3da0d4..afde177 100644 --- a/classRepresentation/parameterGiws.py +++ b/classRepresentation/parameterGiws.py @@ -34,8 +34,6 @@ # # For more information, see the file COPYING -from datatypes.dataGiws import dataGiws -from datatypes.dataBufferGiws import dataBufferGiws from datatypes.dataFactoryGiws import dataFactoryGiws diff --git a/datatypes/ByteBufferDataGiws.py b/datatypes/ByteBufferDataGiws.py index 01f267e..67f33d7 100644 --- a/datatypes/ByteBufferDataGiws.py +++ b/datatypes/ByteBufferDataGiws.py @@ -35,8 +35,6 @@ # For more information, see the file COPYING from datatypes.dataBufferGiws import dataBufferGiws -from configGiws import configGiws -from JNIFrameWork import JNIFrameWork class ByteBufferDataGiws(dataBufferGiws): diff --git a/datatypes/CharBufferDataGiws.py b/datatypes/CharBufferDataGiws.py index c738a17..aa59e42 100644 --- a/datatypes/CharBufferDataGiws.py +++ b/datatypes/CharBufferDataGiws.py @@ -35,8 +35,6 @@ # For more information, see the file COPYING from datatypes.dataBufferGiws import dataBufferGiws -from configGiws import configGiws -from JNIFrameWork import JNIFrameWork class CharBufferDataGiws(dataBufferGiws): diff --git a/datatypes/DoubleBufferDataGiws.py b/datatypes/DoubleBufferDataGiws.py index 1da7e28..9f8cf02 100644 --- a/datatypes/DoubleBufferDataGiws.py +++ b/datatypes/DoubleBufferDataGiws.py @@ -35,8 +35,6 @@ # For more information, see the file COPYING from datatypes.dataBufferGiws import dataBufferGiws -from configGiws import configGiws -from JNIFrameWork import JNIFrameWork class DoubleBufferDataGiws(dataBufferGiws): diff --git a/datatypes/FloatBufferDataGiws.py b/datatypes/FloatBufferDataGiws.py index 4a38de5..830c628 100644 --- a/datatypes/FloatBufferDataGiws.py +++ b/datatypes/FloatBufferDataGiws.py @@ -35,8 +35,6 @@ # For more information, see the file COPYING from datatypes.dataBufferGiws import dataBufferGiws -from configGiws import configGiws -from JNIFrameWork import JNIFrameWork class FloatBufferDataGiws(dataBufferGiws): diff --git a/datatypes/IntBufferDataGiws.py b/datatypes/IntBufferDataGiws.py index 3b4c9bc..54126a6 100644 --- a/datatypes/IntBufferDataGiws.py +++ b/datatypes/IntBufferDataGiws.py @@ -35,8 +35,6 @@ # For more information, see the file COPYING from datatypes.dataBufferGiws import dataBufferGiws -from configGiws import configGiws -from JNIFrameWork import JNIFrameWork class IntBufferDataGiws(dataBufferGiws): diff --git a/datatypes/LongBufferDataGiws.py b/datatypes/LongBufferDataGiws.py index fb730f6..f04749a 100644 --- a/datatypes/LongBufferDataGiws.py +++ b/datatypes/LongBufferDataGiws.py @@ -35,8 +35,6 @@ # For more information, see the file COPYING from datatypes.dataBufferGiws import dataBufferGiws -from configGiws import configGiws -from JNIFrameWork import JNIFrameWork class LongBufferDataGiws(dataBufferGiws): diff --git a/datatypes/ShortBufferDataGiws.py b/datatypes/ShortBufferDataGiws.py index b307acd..7e9b08c 100644 --- a/datatypes/ShortBufferDataGiws.py +++ b/datatypes/ShortBufferDataGiws.py @@ -35,8 +35,6 @@ # For more information, see the file COPYING from datatypes.dataBufferGiws import dataBufferGiws -from configGiws import configGiws -from JNIFrameWork import JNIFrameWork class ShortBufferDataGiws(dataBufferGiws): diff --git a/datatypes/booleanDataGiws.py b/datatypes/booleanDataGiws.py index e213450..3f52aff 100644 --- a/datatypes/booleanDataGiws.py +++ b/datatypes/booleanDataGiws.py @@ -108,7 +108,7 @@ def specificPostProcessing(self, detachThread): if self.isArray(): str = JNIFrameWork().getExceptionCheckProfile(detachThread) strCommon = "" - if configGiws().getDisableReturnSize() == True: + if configGiws().getDisableReturnSize() is True: strCommon += "int *lenRow;" strCommon += """ *lenRow = curEnv->GetArrayLength(res); @@ -135,7 +135,7 @@ def specificPostProcessing(self, detachThread): """ ) else: - if configGiws().getDisableReturnSize() == True: + if configGiws().getDisableReturnSize() is True: str += "int *lenCol;" return ( str diff --git a/datatypes/dataBufferGiws.py b/datatypes/dataBufferGiws.py index dd13392..f7dec79 100644 --- a/datatypes/dataBufferGiws.py +++ b/datatypes/dataBufferGiws.py @@ -72,18 +72,18 @@ def specificPreProcessing(self, parameter, detachThread): # Management of the error when not enough memory to create the # XXXXXBuffer if configGiws().getThrowsException(): - errorMgntMem = """%sthrow %s::JniBadAllocException(curEnv);""" % ( + """%sthrow %s::JniBadAllocException(curEnv);""" % ( detachThread, configGiws().getExceptionFileName(), ) else: - errorMgntMem = """std::cerr << "Could not allocate Java %s array, memory full." << std::endl;%s + """std::cerr << "Could not allocate Java %s array, memory full." << std::endl;%s exit(EXIT_FAILURE);""" % ( self.getJavaBufferType(), detachThread, ) - errorMgntMemBis = self.__errorMemoryByteBuffer(detachThread) + self.__errorMemoryByteBuffer(detachThread) str = """ @@ -189,7 +189,7 @@ def specificPostProcessing(self, detachThread): if self.isArray(): strCommon = "" strDeclaration = "" - if configGiws().getDisableReturnSize() == True: + if configGiws().getDisableReturnSize() is True: strCommon += "int lenRow;" else: # The size of the array is returned as output argument of the @@ -217,7 +217,7 @@ def specificPostProcessing(self, detachThread): ) return str else: - if configGiws().getDisableReturnSize() == True: + if configGiws().getDisableReturnSize() is True: str += "int lenCol;" str += ( strCommon diff --git a/datatypes/dataFactoryGiws.py b/datatypes/dataFactoryGiws.py index 5987136..3357a43 100644 --- a/datatypes/dataFactoryGiws.py +++ b/datatypes/dataFactoryGiws.py @@ -51,7 +51,6 @@ from datatypes.FloatBufferDataGiws import FloatBufferDataGiws from datatypes.IntBufferDataGiws import IntBufferDataGiws from datatypes.ShortBufferDataGiws import ShortBufferDataGiws -import datatypes """ Factory which create the different data types """ @@ -74,7 +73,6 @@ def __init__(self): "DoubleBuffer": DoubleBufferDataGiws, "ByteBuffer": ByteBufferDataGiws, "CharBuffer": CharBufferDataGiws, - "DoubleBuffer": DoubleBufferDataGiws, "FloatBuffer": FloatBufferDataGiws, "IntBuffer": IntBufferDataGiws, "LongBuffer": LongBufferDataGiws, diff --git a/datatypes/dataGiws.py b/datatypes/dataGiws.py index 750412c..06e6309 100644 --- a/datatypes/dataGiws.py +++ b/datatypes/dataGiws.py @@ -34,7 +34,6 @@ # # For more information, see the file COPYING -import sys from configGiws import configGiws from JNIFrameWork import JNIFrameWork @@ -258,9 +257,9 @@ def specificPostDeleteMemory(self, parameter): def specificPostProcessing(self, detachThread): """Preprocessing after calling the java method""" - javaType = self.getJavaTypeSyntax() + self.getJavaTypeSyntax() javaTypeNotArray = self.getJavaTypeSyntaxForceNotArray() - shortType = self.getJavaShortType(forceNotArray=True) + self.getJavaShortType(forceNotArray=True) nativeTypeForceNotArray = self.getNativeTypeForceNotArray() if self.isArray(): @@ -269,7 +268,7 @@ def specificPostProcessing(self, detachThread): str += JNIFrameWork().getExceptionCheckProfile(detachThread) strCommon = "" strDeclaration = "" - if configGiws().getDisableReturnSize() == True: + if configGiws().getDisableReturnSize() is True: strCommon += "int lenRow;" else: # The size of the array is returned as output argument of the @@ -308,7 +307,7 @@ def specificPostProcessing(self, detachThread): return str else: - if configGiws().getDisableReturnSize() == True: + if configGiws().getDisableReturnSize() is True: str += "int lenCol;" str += ( strCommon diff --git a/datatypes/stringDataGiws.py b/datatypes/stringDataGiws.py index 8728093..091dd21 100644 --- a/datatypes/stringDataGiws.py +++ b/datatypes/stringDataGiws.py @@ -221,7 +221,7 @@ def specificPostProcessing(self, detachThread): if self.isArray(): strCommon = "" strDeclaration = "" - if configGiws().getDisableReturnSize() == True: + if configGiws().getDisableReturnSize() is True: strCommon += "int lenRow;" else: # The size of the array is returned as output argument of the @@ -253,7 +253,7 @@ def specificPostProcessing(self, detachThread): ) return str else: - if configGiws().getDisableReturnSize() == True: + if configGiws().getDisableReturnSize() is True: str += "int lenCol;" str += ( strCommon