mailr6587 - /1.3/prompt/relax_data.py


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

Header


Content

Posted by edward on June 29, 2008 - 14:58:
Author: bugman
Date: Sun Jun 29 14:51:18 2008
New Revision: 6587

URL: http://svn.gna.org/viewcvs/relax?rev=6587&view=rev
Log:
Fixed the checking of the pipe_from and pipe_to args in the relax_data.copy() 
user function.


Modified:
    1.3/prompt/relax_data.py

Modified: 1.3/prompt/relax_data.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/relax_data.py?rev=6587&r1=6586&r2=6587&view=diff
==============================================================================
--- 1.3/prompt/relax_data.py (original)
+++ 1.3/prompt/relax_data.py Sun Jun 29 14:51:18 2008
@@ -26,7 +26,7 @@
 # relax module imports.
 import help
 from generic_fns import relax_data
-from relax_errors import RelaxBoolError, RelaxBinError, RelaxFloatError, 
RelaxIntError, RelaxNoneIntError, RelaxNoneStrError, RelaxStrError
+from relax_errors import RelaxError, RelaxBoolError, RelaxBinError, 
RelaxFloatError, RelaxIntError, RelaxNoneIntError, RelaxNoneStrError, 
RelaxStrError
 
 
 class Relax_data:
@@ -130,12 +130,16 @@
             print text
 
         # The pipe_from argument.
-        if type(pipe_from) != str:
-            raise RelaxStrError, ('pipe_from', pipe_from)
+        if pipe_from != None and type(pipe_from) != str:
+            raise RelaxNoneStrError, ('pipe_from', pipe_from)
 
         # The pipe_to argument.
-        if type(pipe_to) != str:
-            raise RelaxStrError, ('pipe_to', pipe_to)
+        if pipe_to != None and type(pipe_to) != str:
+            raise RelaxNoneStrError, ('pipe_to', pipe_to)
+
+        # Both pipe arguments cannot be None.
+        if pipe_from == None and pipe_to == None:
+            raise RelaxError, "The pipe_from and pipe_to arguments cannot 
both be set to None."
 
         # Relaxation data type.
         if ri_label != None and type(ri_label) != str:




Related Messages


Powered by MHonArc, Updated Sun Jun 29 15:00:27 2008