Author: bugman Date: Wed Jan 18 15:36:59 2012 New Revision: 15169 URL: http://svn.gna.org/viewcvs/relax?rev=15169&view=rev Log: Created the Param_list.get_grace_string() method for returning the Grace string. Modified: branches/spec_api/specific_fns/api_objects.py Modified: branches/spec_api/specific_fns/api_objects.py URL: http://svn.gna.org/viewcvs/relax/branches/spec_api/specific_fns/api_objects.py?rev=15169&r1=15168&r2=15169&view=diff ============================================================================== --- branches/spec_api/specific_fns/api_objects.py (original) +++ branches/spec_api/specific_fns/api_objects.py Wed Jan 18 15:36:59 2012 @@ -23,6 +23,8 @@ # Module docstring. """A module of special objects used within the specific function API.""" +# relax module imports. +from relax_errors import RelaxError class Param_list: @@ -87,3 +89,20 @@ # No match. return False + + + def get_grace_string(self, name): + """Return the Grace string for the parameter. + + @param name: The name of the parameter. + @type name: str + @return: The Grace string. + @rtype: str + """ + + # Check. + if name not in self.names: + raise RelaxError("The parameter '%s' does not exist." % name) + + # Return the value. + return self.grace_string[name]