mailr26098 - /trunk/pipe_control/pipes.py


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

Header


Content

Posted by edward on September 30, 2014 - 16:56:
Author: bugman
Date: Tue Sep 30 16:56:28 2014
New Revision: 26098

URL: http://svn.gna.org/viewcvs/relax?rev=26098&view=rev
Log:
Fixes and simplifications for the pipe_control.pipes.check_pipe() checking 
object.

One of the RelaxError classes were not initialised and the docstring was 
incorrect.


Modified:
    trunk/pipe_control/pipes.py

Modified: trunk/pipe_control/pipes.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/pipes.py?rev=26098&r1=26097&r2=26098&view=diff
==============================================================================
--- trunk/pipe_control/pipes.py (original)
+++ trunk/pipe_control/pipes.py Tue Sep 30 16:56:28 2014
@@ -126,16 +126,13 @@
 
 
 def check_pipe_func(pipe_name=None):
-    """Testing for the existence of the current or supplied data pipe.
+    """Test for the existence of the current or supplied data pipe.
 
     @param pipe_name:   The name of the data pipe to switch to.
     @type pipe_name:    str
-    @return:            The answer to the question of whether the pipe 
exists.
-    @rtype:             Boolean
-    """
-
-    # Init.
-    error = None
+    @return:            The initialised RelaxError object or nothing.
+    @rtype:             None or RelaxError instance
+    """
 
     # No supplied data pipe and no current data pipe.
     if pipe_name == None:
@@ -144,14 +141,11 @@
 
         # Still no luck.
         if pipe_name == None:
-            error = RelaxNoPipeError
+            return RelaxNoPipeError()
 
     # Test if the data pipe exists.
     if pipe_name not in ds:
-        error = RelaxNoPipeError(pipe_name)
-
-    # Return the error.
-    return error
+        return RelaxNoPipeError(pipe_name)
 
 # Create the checking object.
 check_pipe = Check(check_pipe_func)




Related Messages


Powered by MHonArc, Updated Tue Sep 30 17:40:02 2014