mailr16582 - /branches/uf_redesign/prompt/uf_objects.py


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

Header


Content

Posted by edward on June 01, 2012 - 11:17:
Author: bugman
Date: Fri Jun  1 11:17:34 2012
New Revision: 16582

URL: http://svn.gna.org/viewcvs/relax?rev=16582&view=rev
Log:
Added a check in the prompt help _build_doc() method for the uf description.

This should, together with the _build_doc() unit tests, help to uncover all 
unconverted user function
'desc' variables.


Modified:
    branches/uf_redesign/prompt/uf_objects.py

Modified: branches/uf_redesign/prompt/uf_objects.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/prompt/uf_objects.py?rev=16582&r1=16581&r2=16582&view=diff
==============================================================================
--- branches/uf_redesign/prompt/uf_objects.py (original)
+++ branches/uf_redesign/prompt/uf_objects.py Fri Jun  1 11:17:34 2012
@@ -31,6 +31,7 @@
 from relax_string import strip_lead
 from status import Status; status = Status()
 from user_functions.data import Uf_info; uf_info = Uf_info()
+from user_functions.objects import Desc_container
 
 
 class Class_container(object):
@@ -272,6 +273,13 @@
         @rtype:     str
         """
 
+        # Checks.
+        if not isinstance(self._desc, list):
+            raise RelaxError("The user function 'desc' variable must be a 
list of Desc_container instances.")
+        for i in range(len(self._desc)):
+            if not isinstance(self._desc[i], Desc_container):
+                raise RelaxError("The user function 'desc' list element '%s' 
must be a list of Desc_container instances." % self._desc[i])
+
         # Initialise.
         doc = ""
 




Related Messages


Powered by MHonArc, Updated Fri Jun 01 11:40:01 2012