mailr16250 - in /branches/uf_redesign: prompt/ user_functions/


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on May 11, 2012 - 20:52:
Author: bugman
Date: Fri May 11 20:52:44 2012
New Revision: 16250

URL: http://svn.gna.org/viewcvs/relax?rev=16250&view=rev
Log:
Converted the sys_info user function to the auto-generation design.


Added:
    branches/uf_redesign/user_functions/sys_info.py
      - copied, changed from r16248, branches/uf_redesign/prompt/sys_info.py
Removed:
    branches/uf_redesign/prompt/sys_info.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=16250&r1=16249&r2=16250&view=diff
==============================================================================
--- branches/uf_redesign/prompt/__init__.py (original)
+++ branches/uf_redesign/prompt/__init__.py Fri May 11 20:52:44 2012
@@ -28,7 +28,6 @@
            'help',
            'interpreter',
            'objects',
-           'sys_info',
            'tab_completion',
            'temperature',
            'value',

Modified: branches/uf_redesign/prompt/interpreter.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/prompt/interpreter.py?rev=16250&r1=16249&r2=16250&view=diff
==============================================================================
--- branches/uf_redesign/prompt/interpreter.py (original)
+++ branches/uf_redesign/prompt/interpreter.py Fri May 11 20:52:44 2012
@@ -56,7 +56,6 @@
 
 # User functions.
 from gpl import GPL
-from sys_info import Sys_info
 from temperature import Temp
 
 # User classes.
@@ -169,11 +168,9 @@
         objects['gpl'] = objects['GPL'] = GPL()
 
         # Initialise the user functions (those not in user function classes)
-        sys_info = Sys_info()
         temp = Temp()
 
         # Place the user functions in the local namespace.
-        objects['sys_info'] = sys_info.sys_info
         objects['temperature'] = temp.set
 
         # Place the user classes in the local namespace.

Removed: branches/uf_redesign/prompt/sys_info.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/prompt/sys_info.py?rev=16249&view=auto
==============================================================================
--- branches/uf_redesign/prompt/sys_info.py (original)
+++ branches/uf_redesign/prompt/sys_info.py (removed)
@@ -1,51 +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 'sys_info' user function class."""
-__docformat__ = 'plaintext'
-
-# relax module imports.
-from base_class import _build_doc
-from generic_fns.sys_info import sys_info
-from status import Status; status = Status()
-
-
-class Sys_info:
-    """Class containing the sys_info function."""
-
-    def sys_info(self):
-        # Function intro text.
-        if status.prompt_intro:
-            text = status.ps3 + "sys_info()"
-            print(text)
-
-        # Execute the functional code.
-        sys_info()
-
-    sys_info._doc_title = "Display all system information relating to this 
version of relax."
-    sys_info._doc_title_short = "Display system information."
-    sys_info._doc_desc = """
-        This will display all of the relax, Python, python package and 
hardware information currently being used by relax.  This is useful for 
seeing if all packages are up to date and if the correct software versions 
are being used.  It is also very useful information for reporting relax bugs.
-        """
-    _build_doc(sys_info)
-

Modified: branches/uf_redesign/user_functions/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/user_functions/__init__.py?rev=16250&r1=16249&r2=16250&view=diff
==============================================================================
--- branches/uf_redesign/user_functions/__init__.py (original)
+++ branches/uf_redesign/user_functions/__init__.py Fri May 11 20:52:44 2012
@@ -73,7 +73,8 @@
     'spectrum',
     'spin',
     'state',
-    'structure'
+    'structure',
+    'sys_info'
 ]
 
 # Import all the modules to set up the data.
@@ -117,6 +118,7 @@
 import user_functions.spin
 import user_functions.state
 import user_functions.structure
+import user_functions.sys_info
 
 # Import the data structure.
 from user_functions.data import Uf_info; uf_info = Uf_info()

Copied: branches/uf_redesign/user_functions/sys_info.py (from r16248, 
branches/uf_redesign/prompt/sys_info.py)
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/user_functions/sys_info.py?p2=branches/uf_redesign/user_functions/sys_info.py&p1=branches/uf_redesign/prompt/sys_info.py&r1=16248&r2=16250&rev=16250&view=diff
==============================================================================
--- branches/uf_redesign/prompt/sys_info.py (original)
+++ branches/uf_redesign/user_functions/sys_info.py Fri May 11 20:52:44 2012
@@ -21,31 +21,23 @@
 
###############################################################################
 
 # Module docstring.
-"""Module containing the 'sys_info' user function class."""
-__docformat__ = 'plaintext'
+"""Module containing the 'sys_info' user function data."""
 
 # relax module imports.
-from base_class import _build_doc
 from generic_fns.sys_info import sys_info
-from status import Status; status = Status()
+from graphics import WIZARD_IMAGE_PATH
+from user_functions.data import Uf_info; uf_info = Uf_info()
 
 
-class Sys_info:
-    """Class containing the sys_info function."""
-
-    def sys_info(self):
-        # Function intro text.
-        if status.prompt_intro:
-            text = status.ps3 + "sys_info()"
-            print(text)
-
-        # Execute the functional code.
-        sys_info()
-
-    sys_info._doc_title = "Display all system information relating to this 
version of relax."
-    sys_info._doc_title_short = "Display system information."
-    sys_info._doc_desc = """
-        This will display all of the relax, Python, python package and 
hardware information currently being used by relax.  This is useful for 
seeing if all packages are up to date and if the correct software versions 
are being used.  It is also very useful information for reporting relax bugs.
-        """
-    _build_doc(sys_info)
-
+# The sys_info user function.
+uf = uf_info.add_uf('sys_info')
+uf.title = "Display all system information relating to this version of 
relax."
+uf.title_short = "Display system information."
+uf.display = True
+uf.desc = """
+This will display all of the relax, Python, python package and hardware 
information currently being used by relax.  This is useful for seeing if all 
packages are up to date and if the correct software versions are being used.  
It is also very useful information for reporting relax bugs.
+"""
+uf.backend = sys_info
+uf.menu_text = "s&ys_info"
+uf.gui_icon = "oxygen.actions.help-about"
+uf.wizard_apply_button = False




Related Messages


Powered by MHonArc, Updated Fri May 11 21:00:02 2012