[cig-commits] r4551 - in short/3D/PyLith/trunk: modulesrc/meshio pylith/meshio

baagaard at geodynamics.org baagaard at geodynamics.org
Thu Sep 14 20:49:20 PDT 2006


Author: baagaard
Date: 2006-09-14 20:49:20 -0700 (Thu, 14 Sep 2006)
New Revision: 4551

Modified:
   short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe
   short/3D/PyLith/trunk/pylith/meshio/MeshIO.py
   short/3D/PyLith/trunk/pylith/meshio/MeshIOAscii.py
Log:
Added missing filename as property.

Modified: short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe
===================================================================
--- short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe	2006-09-15 03:11:32 UTC (rev 4550)
+++ short/3D/PyLith/trunk/modulesrc/meshio/meshio.pyxe	2006-09-15 03:49:20 UTC (rev 4551)
@@ -96,6 +96,24 @@
     return PyCObject_FromVoidPtr(self.thisptr, MeshIO_destructor)
 
 
+  property filename:
+    def __set__(self, name):
+      """Set filename."""
+      # create shim for method 'filename'
+      #embed{ void MeshIOAscii_filename_set(void* pObj, char* name)
+      ((pylith::meshio::MeshIOAscii*) pObj)->filename(name);
+      #}embed
+      MeshIOAscii_filename_set(self.thisptr, name)
+
+    def __get__(self):
+      """Get filename."""
+      # create shim for method 'filename'
+      #embed{ char* MeshIOAscii_filename_get(void* pObj)
+      return (char*) ((pylith::meshio::MeshIOAscii*) pObj)->filename();
+      #}embed
+      return MeshIOAscii_filename_get(self.thisptr)
+
+
 # ----------------------------------------------------------------------
 cdef class MeshIOAscii(MeshIO):
 

Modified: short/3D/PyLith/trunk/pylith/meshio/MeshIO.py
===================================================================
--- short/3D/PyLith/trunk/pylith/meshio/MeshIO.py	2006-09-15 03:11:32 UTC (rev 4550)
+++ short/3D/PyLith/trunk/pylith/meshio/MeshIO.py	2006-09-15 03:49:20 UTC (rev 4551)
@@ -22,6 +22,8 @@
   Python abstract base class for finite-element mesh I/O.
   """
 
+  # INVENTORY //////////////////////////////////////////////////////////
+
   class Inventory(Component.Inventory):
     """Python object for managing MeshIO facilities and properties."""
 
@@ -79,6 +81,7 @@
 
   def _configure(self):
     """Set members based using inventory."""
+    Component._configure(self)
     self.interpolate = self.inventory.interpolate
     return
 

Modified: short/3D/PyLith/trunk/pylith/meshio/MeshIOAscii.py
===================================================================
--- short/3D/PyLith/trunk/pylith/meshio/MeshIOAscii.py	2006-09-15 03:11:32 UTC (rev 4550)
+++ short/3D/PyLith/trunk/pylith/meshio/MeshIOAscii.py	2006-09-15 03:49:20 UTC (rev 4551)
@@ -24,6 +24,26 @@
   ASCII file.
   """
 
+  # INVENTORY //////////////////////////////////////////////////////////
+
+  class Inventory(Component.Inventory):
+    """Python object for managing MeshIOAscii facilities and properties."""
+
+    ## @class Inventory
+    ## Python object for managing MeshIOAscii facilities and properties.
+    ##
+    ## \b Properties
+    ## @li \b filename Name of mesh file
+    ##
+    ## \b Facilities
+    ## @li None
+
+    import pyre.inventory
+
+    filename = pyre.inventory.str("filename", default=False)
+    filename.meta['tip'] = "Name of mesh file"
+
+
   # PUBLIC METHODS /////////////////////////////////////////////////////
 
   def __init__(self, name="meshioascii"):
@@ -34,6 +54,15 @@
     return
 
 
+  # PRIVATE METHODS ////////////////////////////////////////////////////
+
+  def _configure(self):
+    """Set members based using inventory."""
+    MeshIO.configure(self)
+    self.filename = self.inventory.filename
+    return
+
+
 # version
 __id__ = "$Id$"
 



More information about the cig-commits mailing list