]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Nicer constructors of SauvReader and SauvWriter.
authorageay <ageay>
Fri, 13 Dec 2013 07:26:31 +0000 (07:26 +0000)
committerageay <ageay>
Fri, 13 Dec 2013 07:26:31 +0000 (07:26 +0000)
src/MEDLoader/Swig/MEDLoaderCommon.i
src/MEDLoader/Swig/SauvLoaderTest.py

index d142dd119a2f145c5e84badb67b4c4f7be21da23..9ee9521c1f296e6f3f39827f3c9e79e4f7db8ce8 100644 (file)
@@ -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();
+      }
+    }
   };
   
   ///////////////
index 8cd667ffd10372a7f4649efc0887711b1334eff2..c122256e963edf121eee1a70870e32abc6ee8feb 100644 (file)
@@ -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);