From: ageay Date: Fri, 13 Dec 2013 07:26:31 +0000 (+0000) Subject: Nicer constructors of SauvReader and SauvWriter. X-Git-Tag: V7_3_0~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bcfc571de250bd2996c35fe2ddd850f82170aaac;p=modules%2Fmed.git Nicer constructors of SauvReader and SauvWriter. --- diff --git a/src/MEDLoader/Swig/MEDLoaderCommon.i b/src/MEDLoader/Swig/MEDLoaderCommon.i index d142dd119..9ee9521c1 100644 --- a/src/MEDLoader/Swig/MEDLoaderCommon.i +++ b/src/MEDLoader/Swig/MEDLoaderCommon.i @@ -2819,6 +2819,13 @@ namespace ParaMEDMEM public: static SauvReader* New(const char *fileName) throw(INTERP_KERNEL::Exception); MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception); + %extend + { + SauvReader(const char *fileName) throw(INTERP_KERNEL::Exception) + { + return SauvReader::New(fileName); + } + } }; class SauvWriter : public RefCountObject @@ -2829,6 +2836,13 @@ namespace ParaMEDMEM void write(const char* fileName) throw(INTERP_KERNEL::Exception); void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception); bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception); + %extend + { + SauvWriter() throw(INTERP_KERNEL::Exception) + { + return SauvWriter::New(); + } + } }; /////////////// diff --git a/src/MEDLoader/Swig/SauvLoaderTest.py b/src/MEDLoader/Swig/SauvLoaderTest.py index 8cd667ffd..c122256e9 100644 --- a/src/MEDLoader/Swig/SauvLoaderTest.py +++ b/src/MEDLoader/Swig/SauvLoaderTest.py @@ -34,7 +34,7 @@ class SauvLoaderTest(unittest.TestCase): # read SAUV and write MED medFile = "SauvLoaderTest.med" - sr=SauvReader.New(sauvFile); + sr=SauvReader(sauvFile); d2=sr.loadInMEDFileDS(); d2.write(medFile,0); @@ -95,7 +95,7 @@ class SauvLoaderTest(unittest.TestCase): # write pointeMed to SAUV sauvFile = "SauvLoaderTest.sauv" - sw=SauvWriter.New(); + sw=SauvWriter(); sw.setMEDFileDS(pointeMed); sw.write(sauvFile);