Author: bugman Date: Tue May 8 17:26:54 2012 New Revision: 16111 URL: http://svn.gna.org/viewcvs/relax?rev=16111&view=rev Log: Converted the frq user functions to the auto-generation design. Added: branches/uf_redesign/user_functions/frq.py - copied, changed from r16108, branches/uf_redesign/prompt/frq.py Removed: branches/uf_redesign/prompt/frq.py Modified: branches/uf_redesign/prompt/__init__.py branches/uf_redesign/prompt/interpreter.py branches/uf_redesign/user_functions/__init__.py Modified: branches/uf_redesign/prompt/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/prompt/__init__.py?rev=16111&r1=16110&r2=16111&view=diff ============================================================================== --- branches/uf_redesign/prompt/__init__.py (original) +++ branches/uf_redesign/prompt/__init__.py Tue May 8 17:26:54 2012 @@ -24,7 +24,6 @@ __all__ = ['base_class', 'command', 'doc_string', - 'frq', 'gpl', 'grace', 'help', Removed: branches/uf_redesign/prompt/frq.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/prompt/frq.py?rev=16110&view=auto ============================================================================== --- branches/uf_redesign/prompt/frq.py (original) +++ branches/uf_redesign/prompt/frq.py (removed) @@ -1,66 +1,0 @@ -############################################################################### -# # -# Copyright (C) 2008-2012 Edward d'Auvergne # -# # -# This file is part of the program relax. # -# # -# relax is free software; you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation; either version 2 of the License, or # -# (at your option) any later version. # -# # -# relax is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with relax; if not, write to the Free Software # -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# # -############################################################################### - -# Module docstring. -"""Module containing the 'frq' user function class for manipulating spectrometer frequencies.""" -__docformat__ = 'plaintext' - -# relax module imports. -from base_class import User_fn_class -import arg_check -import generic_fns.frq -from status import Status; status = Status() - - -class Frq(User_fn_class): - """Class for manipulating spectrometer frequencies.""" - - def set(self, id=None, frq=None): - """Set the spectrometer frequency of the experiment. - - Keyword arguments - ~~~~~~~~~~~~~~~~~ - - id: The experiment identification string. - - frq: The spectrometer frequency in Hertz. - - - Description - ~~~~~~~~~~~ - - This user function allows the spectrometer frequency of a given experiment to be set. - """ - - # Function intro text. - if status.prompt_intro: - text = status.ps3 + "frq(" - text = text + "id=" + repr(id) - text = text + ", frq=" + repr(frq) + ")" - print(text) - - # The argument checks. - arg_check.is_str(id, 'experiment identification string') - arg_check.is_num(frq, 'spectrometer frequency') - - # Execute the functional code. - generic_fns.frq.set(id=id, frq=frq) Modified: branches/uf_redesign/prompt/interpreter.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/prompt/interpreter.py?rev=16111&r1=16110&r2=16111&view=diff ============================================================================== --- branches/uf_redesign/prompt/interpreter.py (original) +++ branches/uf_redesign/prompt/interpreter.py Tue May 8 17:26:54 2012 @@ -61,7 +61,6 @@ from temperature import Temp # User classes. -from frq import Frq from grace import Grace from jw_mapping import Jw_mapping from model_free import Model_free @@ -198,7 +197,6 @@ objects['temperature'] = temp.set # Place the user classes in the local namespace. - objects['frq'] = Frq() objects['grace'] = Grace() objects['jw_mapping'] = Jw_mapping() objects['model_free'] = Model_free() Modified: branches/uf_redesign/user_functions/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/user_functions/__init__.py?rev=16111&r1=16110&r2=16111&view=diff ============================================================================== --- branches/uf_redesign/user_functions/__init__.py (original) +++ branches/uf_redesign/user_functions/__init__.py Tue May 8 17:26:54 2012 @@ -46,6 +46,7 @@ 'eliminate', 'fix', 'frame_order', + 'frq', 'minimisation', 'model_selection', 'molmol', @@ -70,6 +71,7 @@ import user_functions.eliminate import user_functions.fix import user_functions.frame_order +import user_functions.frq import user_functions.minimisation import user_functions.model_selection import user_functions.molmol Copied: branches/uf_redesign/user_functions/frq.py (from r16108, branches/uf_redesign/prompt/frq.py) URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/user_functions/frq.py?p2=branches/uf_redesign/user_functions/frq.py&p1=branches/uf_redesign/prompt/frq.py&r1=16108&r2=16111&rev=16111&view=diff ============================================================================== --- branches/uf_redesign/prompt/frq.py (original) +++ branches/uf_redesign/user_functions/frq.py Tue May 8 17:26:54 2012 @@ -21,46 +21,38 @@ ############################################################################### # Module docstring. -"""Module containing the 'frq' user function class for manipulating spectrometer frequencies.""" -__docformat__ = 'plaintext' +"""Module containing the 'frq' user function data for manipulating spectrometer frequencies.""" # relax module imports. -from base_class import User_fn_class -import arg_check import generic_fns.frq -from status import Status; status = Status() +from graphics import WIZARD_IMAGE_PATH +from user_functions.data import Uf_info; uf_info = Uf_info() -class Frq(User_fn_class): - """Class for manipulating spectrometer frequencies.""" +# The user function class. +uf_class = uf_info.add_class('frq') +uf_class.title = "Class for manipulating spectrometer frequencies." +uf_class.menu_text = "fr&q" - def set(self, id=None, frq=None): - """Set the spectrometer frequency of the experiment. - - Keyword arguments - ~~~~~~~~~~~~~~~~~ - - id: The experiment identification string. - - frq: The spectrometer frequency in Hertz. - - - Description - ~~~~~~~~~~~ - - This user function allows the spectrometer frequency of a given experiment to be set. - """ - - # Function intro text. - if status.prompt_intro: - text = status.ps3 + "frq(" - text = text + "id=" + repr(id) - text = text + ", frq=" + repr(frq) + ")" - print(text) - - # The argument checks. - arg_check.is_str(id, 'experiment identification string') - arg_check.is_num(frq, 'spectrometer frequency') - - # Execute the functional code. - generic_fns.frq.set(id=id, frq=frq) +# The frq.set user function. +uf = uf_info.add_uf('frq.set') +uf.title = "Set the spectrometer frequency of the experiment." +uf.title_short = "Spectrometer frequency setting." +uf.add_keyarg( + name = "id", + py_type = "str", + desc_short = "experiment ID", + desc = "The experiment identification string." +) +uf.add_keyarg( + name = "frq", + py_type = "num", + desc_short = "spectrometer frequency", + desc = "The spectrometer frequency in Hertz." +) +uf.desc = """ +This allows the spectrometer frequency of a given experiment to be set. +""" +uf.backend = generic_fns.frq.set +uf.menu_text = "&set" +uf.wizard_size = (700, 400)