Author: bugman Date: Mon Nov 30 14:46:01 2009 New Revision: 10027 URL: http://svn.gna.org/viewcvs/relax?rev=10027&view=rev Log: Wrote the arg_check.is_none() testing function. Modified: 1.3/arg_check.py Modified: 1.3/arg_check.py URL: http://svn.gna.org/viewcvs/relax/1.3/arg_check.py?rev=10027&r1=10026&r2=10027&view=diff ============================================================================== --- 1.3/arg_check.py (original) +++ 1.3/arg_check.py Mon Nov 30 14:46:01 2009 @@ -249,6 +249,24 @@ raise RelaxListError(name, arg) +def is_none(arg, name): + """Test if the argument is None. + + @param arg: The argument. + @type arg: anything + @param name: The plain English name of the argument. + @type name: str + @raise RelaxNoneError: If not None. + """ + + # Check for None. + if arg == None: + return + + # The RelaxError. + raise RelaxNoneError(name, arg) + + def is_num(arg, name, can_be_none=False): """Test if the argument is a number.