Author: bugman Date: Mon May 7 15:07:37 2012 New Revision: 16051 URL: http://svn.gna.org/viewcvs/relax?rev=16051&view=rev Log: Converted the bruker user functions to the auto-generation design. Added: branches/uf_redesign/user_functions/bruker.py - copied, changed from r16049, branches/uf_redesign/prompt/bruker.py Removed: branches/uf_redesign/prompt/bruker.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=16051&r1=16050&r2=16051&view=diff ============================================================================== --- branches/uf_redesign/prompt/__init__.py (original) +++ branches/uf_redesign/prompt/__init__.py Mon May 7 15:07:37 2012 @@ -23,7 +23,6 @@ __all__ = ['angles', 'base_class', - 'bruker', 'command', 'consistency_tests', 'dasha', Removed: branches/uf_redesign/prompt/bruker.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/prompt/bruker.py?rev=16050&view=auto ============================================================================== --- branches/uf_redesign/prompt/bruker.py (original) +++ branches/uf_redesign/prompt/bruker.py (removed) @@ -1,67 +1,0 @@ -############################################################################### -# # -# Copyright (C) 2011-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 Bruker Dynamics Center user function class.""" -__docformat__ = 'plaintext' - -# relax module imports. -import arg_check -from base_class import User_fn_class, _build_doc -from generic_fns import bruker -from status import Status; status = Status() - - -class Bruker(User_fn_class): - """Class containing the function for reading the Bruker Dynamics Center (DC) files.""" - - def read(self, ri_id=None, file=None, dir=None): - # Function intro text. - if status.prompt_intro: - text = status.ps3 + "bruker.read(" - text = text + "ri_id=" + repr(ri_id) - text = text + ", file=" + repr(file) - text = text + ", dir=" + repr(dir) + ")" - print(text) - - # The argument checks. - arg_check.is_str(ri_id, 'relaxation data ID string') - arg_check.is_str(file, 'file name') - arg_check.is_str(dir, 'directory name', can_be_none=True) - - # Execute the functional code. - bruker.read(ri_id=ri_id, file=file, dir=dir) - - # The function doc info. - read._doc_title = "Read a Bruker Dynamics Center (DC) relaxation data file." - read._doc_title_short = "Read a Bruker Dynamics Center file." - read._doc_args = [ - ["ri_id", "The relaxation data ID string. This must be a unique identifier."], - ["file", "The name of the Bruker Dynamics Center file containing the relaxation data."], - ["dir", "The directory where the file is located."], - ] - read._doc_desc = """ - This user function is used to load all of the data out of a Bruker Dynamics Center (DC) relaxation data file for subsequent analysis within relax. Currently the R1 and R2 relaxation rates and steady-state NOE data is supported. - """ - _build_doc(read) - - Modified: branches/uf_redesign/prompt/interpreter.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/prompt/interpreter.py?rev=16051&r1=16050&r2=16051&view=diff ============================================================================== --- branches/uf_redesign/prompt/interpreter.py (original) +++ branches/uf_redesign/prompt/interpreter.py Mon May 7 15:07:37 2012 @@ -67,7 +67,6 @@ from temperature import Temp # User classes. -from bruker import Bruker from consistency_tests import Consistency_tests from dasha import Dasha from diffusion_tensor import Diffusion_tensor @@ -220,7 +219,6 @@ objects['temperature'] = temp.set # Place the user classes in the local namespace. - objects['bruker'] = Bruker() objects['consistency_tests'] = Consistency_tests() objects['dasha'] = Dasha() objects['deselect'] = Deselect() Modified: branches/uf_redesign/user_functions/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/user_functions/__init__.py?rev=16051&r1=16050&r2=16051&view=diff ============================================================================== --- branches/uf_redesign/user_functions/__init__.py (original) +++ branches/uf_redesign/user_functions/__init__.py Mon May 7 15:07:37 2012 @@ -36,6 +36,7 @@ __all__ += [ 'align_tensor', 'bmrb', + 'bruker', 'pipe', 'relax_data', 'state' @@ -44,6 +45,7 @@ # Import all the modules to set up the data. import user_functions.align_tensor import user_functions.bmrb +import user_functions.bruker import user_functions.pipe import user_functions.relax_data import user_functions.state Copied: branches/uf_redesign/user_functions/bruker.py (from r16049, branches/uf_redesign/prompt/bruker.py) URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/user_functions/bruker.py?p2=branches/uf_redesign/user_functions/bruker.py&p1=branches/uf_redesign/prompt/bruker.py&r1=16049&r2=16051&rev=16051&view=diff ============================================================================== --- branches/uf_redesign/prompt/bruker.py (original) +++ branches/uf_redesign/user_functions/bruker.py Mon May 7 15:07:37 2012 @@ -21,47 +21,52 @@ ############################################################################### # Module docstring. -"""Module containing the Bruker Dynamics Center user function class.""" -__docformat__ = 'plaintext' +"""Module containing the Bruker Dynamics Center user function data.""" # relax module imports. -import arg_check -from base_class import User_fn_class, _build_doc from generic_fns import bruker -from status import Status; status = Status() +from graphics import WIZARD_IMAGE_PATH +from user_functions.data import Uf_info; uf_info = Uf_info() -class Bruker(User_fn_class): - """Class containing the function for reading the Bruker Dynamics Center (DC) files.""" - - def read(self, ri_id=None, file=None, dir=None): - # Function intro text. - if status.prompt_intro: - text = status.ps3 + "bruker.read(" - text = text + "ri_id=" + repr(ri_id) - text = text + ", file=" + repr(file) - text = text + ", dir=" + repr(dir) + ")" - print(text) - - # The argument checks. - arg_check.is_str(ri_id, 'relaxation data ID string') - arg_check.is_str(file, 'file name') - arg_check.is_str(dir, 'directory name', can_be_none=True) - - # Execute the functional code. - bruker.read(ri_id=ri_id, file=file, dir=dir) - - # The function doc info. - read._doc_title = "Read a Bruker Dynamics Center (DC) relaxation data file." - read._doc_title_short = "Read a Bruker Dynamics Center file." - read._doc_args = [ - ["ri_id", "The relaxation data ID string. This must be a unique identifier."], - ["file", "The name of the Bruker Dynamics Center file containing the relaxation data."], - ["dir", "The directory where the file is located."], - ] - read._doc_desc = """ - This user function is used to load all of the data out of a Bruker Dynamics Center (DC) relaxation data file for subsequent analysis within relax. Currently the R1 and R2 relaxation rates and steady-state NOE data is supported. - """ - _build_doc(read) +# The user function class. +uf_class = uf_info.add_class('bruker') +uf_class.title = "Class containing the function for reading the Bruker Dynamics Center (DC) files." +uf_class.menu_text = "&bruker" +uf_class.gui_icon = "relax.bruker" +# The bruker.read user function. +uf = uf_info.add_uf('bruker.read') +uf.title = "Read a Bruker Dynamics Center (DC) relaxation data file." +uf.title_short = "Read a Bruker Dynamics Center file." +uf.add_keyarg( + name = "ri_id", + py_type = "str", + desc_short = "relaxation data ID string", + desc = "The relaxation data ID string. This must be a unique identifier." +) +uf.add_keyarg( + name = "file", + py_type = "str", + arg_type = "file sel", + desc_short = "file name", + desc = "The name of the Bruker Dynamics Center file containing the relaxation data." +) +uf.add_keyarg( + name = "dir", + py_type = "str", + arg_type = "dir", + desc_short = "directory name", + desc = "The directory where the file is located.", + can_be_none = True +) +uf.desc = """ +This user function is used to load all of the data out of a Bruker Dynamics Center (DC) relaxation data file for subsequent analysis within relax. Currently the R1 and R2 relaxation rates and steady-state NOE data is supported. +""" +uf.backend = bruker.read +uf.menu_text = "&read" +uf.gui_icon = "oxygen.actions.document-open" +uf.wizard_height_desc = 140 +uf.wizard_size = (800, 500) +uf.wizard_image = WIZARD_IMAGE_PATH + 'bruker.png'