Author: bugman Date: Fri May 4 10:59:20 2012 New Revision: 15956 URL: http://svn.gna.org/viewcvs/relax?rev=15956&view=rev Log: Created methods for returning user function and class data objects from the user function data object. These are called get_class() and get_uf(). Modified: branches/uf_redesign/user_functions/data.py Modified: branches/uf_redesign/user_functions/data.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/user_functions/data.py?rev=15956&r1=15955&r2=15956&view=diff ============================================================================== --- branches/uf_redesign/user_functions/data.py (original) +++ branches/uf_redesign/user_functions/data.py Fri May 4 10:59:20 2012 @@ -111,6 +111,32 @@ yield self._class_names[i], self._classes[i] + def get_class(self, name): + """Return the user function class data object corresponding to the given name. + + @param name: The name of the user function class. + @type name: str + @return: The class data container. + @rtype: Class_container instance + """ + + # Return the object. + return self._classes[self._class_names.index(name)] + + + def get_uf(self, name): + """Return the user function data object corresponding to the given name. + + @param name: The name of the user function. + @type name: str + @return: The user function data container. + @rtype: Uf_container instance + """ + + # Return the object. + return self._uf[self._uf_names.index(name)] + + def uf_loop(self): """Iterator method for looping over the user functions.