mailr3131 - /1.3/data/pipe_container.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on March 09, 2007 - 09:01:
Author: bugman
Date: Fri Mar  9 09:00:51 2007
New Revision: 3131

URL: http://svn.gna.org/viewcvs/relax?rev=3131&view=rev
Log:
Bug fix.

The __repr__ method of the PipeContainer was failing because of the call to 
getattr() for the 'mol'
object.  Now the 'mol', 'diff', and 'structure' objects are not sent to 
getattr(), rather a special
description is given rather than the object's attribute.


Modified:
    1.3/data/pipe_container.py

Modified: 1.3/data/pipe_container.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/data/pipe_container.py?rev=3131&r1=3130&r2=3131&view=diff
==============================================================================
--- 1.3/data/pipe_container.py (original)
+++ 1.3/data/pipe_container.py Fri Mar  9 09:00:51 2007
@@ -67,12 +67,30 @@
         # Intro text.
         text = "The data pipe storage object.\n"
 
+        # Special objects/methods (to avoid the getattr() function call on).
+        spec_obj = ['mol', 'diff', 'structure']
+
         # Objects.
         text = text + "\n"
         text = text + "Objects:\n"
         for name in dir(self):
-            if match("^_", name):
+            # Molecular list.
+            if name == 'mol':
+                text = text + "  mol: The molecule list (for the storage of 
the spin system specific data)\n"
+
+            # Diffusion tensor.
+            if name == 'diff':
+                text = text + "  diff: The Brownian rotational diffusion 
tensor data object\n"
+
+            # Molecular structure.
+            if name == 'structure':
+                text = text + "  structure: The 3D molecular data object\n"
+
+            # Skip certain objects.
+            if match("^_", name) or name in spec_obj:
                 continue
+
+            # Add the object's attribute to the text string.
             text = text + "  " + name + ": " + `getattr(self, name)` + "\n"
 
         # Return the text representation.




Related Messages


Powered by MHonArc, Updated Fri Mar 09 09:20:05 2007