Author: bugman Date: Tue Dec 7 01:04:46 2010 New Revision: 11718 URL: http://svn.gna.org/viewcvs/relax?rev=11718&view=rev Log: Created a base class for the user function GUI elements. Added: branches/bieri_gui/gui_bieri/user_functions/base.py Modified: branches/bieri_gui/gui_bieri/user_functions/__init__.py branches/bieri_gui/gui_bieri/user_functions/script.py Modified: branches/bieri_gui/gui_bieri/user_functions/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/user_functions/__init__.py?rev=11718&r1=11717&r2=11718&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/user_functions/__init__.py (original) +++ branches/bieri_gui/gui_bieri/user_functions/__init__.py Tue Dec 7 01:04:46 2010 @@ -31,7 +31,8 @@ # The package __all__ list. -__all__ = ['script'] +__all__ = ['base', + 'script'] class User_functions: Added: branches/bieri_gui/gui_bieri/user_functions/base.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/user_functions/base.py?rev=11718&view=auto ============================================================================== --- branches/bieri_gui/gui_bieri/user_functions/base.py (added) +++ branches/bieri_gui/gui_bieri/user_functions/base.py Tue Dec 7 01:04:46 2010 @@ -1,0 +1,38 @@ +############################################################################### +# # +# Copyright (C) 2010 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. +"""Base class module for the user function GUI elements.""" + +# relax GUI module imports. +from gui_bieri.controller import Redirect_text + + +class UF_base: + """User function GUI element base class.""" + + def __init__(self, gui, interpreter): + """Set up the user function class.""" + + # Store the args. + self.gui = gui + self.interpreter = interpreter Modified: branches/bieri_gui/gui_bieri/user_functions/script.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/user_functions/script.py?rev=11718&r1=11717&r2=11718&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/user_functions/script.py (original) +++ branches/bieri_gui/gui_bieri/user_functions/script.py Tue Dec 7 01:04:46 2010 @@ -24,19 +24,12 @@ """The script user functions.""" # GUI module imports. +from base import UF_base from gui_bieri.filedialog import openfile -class Script: +class Script(UF_base): """The script user function GUI class.""" - - def __init__(self, gui, interpreter): - """Set up the user function class.""" - - # Store the args. - self.gui = gui - self.interpreter = interpreter - def run(self, event): """The script user function GUI element.