mailr27023 - /branches/nmrglue/data_store/nmrglue.py


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

Header


Content

Posted by edward on December 08, 2014 - 17:49:
Author: bugman
Date: Mon Dec  8 17:49:37 2014
New Revision: 27023

URL: http://svn.gna.org/viewcvs/relax?rev=27023&view=rev
Log:
Fixes and improvements for the data_store.nmrglue.Nmrglue object __repr__() 
method.

The Element class objects are now skipped, avoiding recursive __repr__() 
problems.  And the string
returned is now better formatted.


Modified:
    branches/nmrglue/data_store/nmrglue.py

Modified: branches/nmrglue/data_store/nmrglue.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/nmrglue/data_store/nmrglue.py?rev=27023&r1=27022&r2=27023&view=diff
==============================================================================
--- branches/nmrglue/data_store/nmrglue.py      (original)
+++ branches/nmrglue/data_store/nmrglue.py      Mon Dec  8 17:49:37 2014
@@ -37,12 +37,12 @@
 
     def __repr__(self):
         # Header.
-        text = "%-25s%-100s\n\n" % ("Data structure", "Value")
+        text = "\n%-25s%-100s\n\n" % ("Data structure", "Value")
 
         # Data structures.
         for name in dir(self):
             # Skip Nmrglue and derived class methods.
-            if name in Nmrglue.__dict__ or name in self.__class__.__dict__:
+            if name in Element.__dict__ or name in Nmrglue.__dict__ or name 
in self.__class__.__dict__:
                 continue
 
             # Skip special objects.
@@ -54,6 +54,7 @@
 
             # The data.
             if name == 'data':
+                name = "data.shape"
                 obj = obj.shape
 
             # Generate the text.




Related Messages


Powered by MHonArc, Updated Mon Dec 08 18:00:02 2014