mailr14725 - in /1.3: generic_fns/sys_info.py prompt/interpreter.py prompt/sys_info.py


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

Header


Content

Posted by edward on September 21, 2011 - 11:51:
Author: bugman
Date: Wed Sep 21 11:51:44 2011
New Revision: 14725

URL: http://svn.gna.org/viewcvs/relax?rev=14725&view=rev
Log:
Created the front and backend of the sys_info user function.

This displays the same text as 'relax -i'.  This will be useful on the Mac OS 
X app, as the command
line is not available.


Added:
    1.3/generic_fns/sys_info.py
    1.3/prompt/sys_info.py
Modified:
    1.3/prompt/interpreter.py

Added: 1.3/generic_fns/sys_info.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/sys_info.py?rev=14725&view=auto
==============================================================================
--- 1.3/generic_fns/sys_info.py (added)
+++ 1.3/generic_fns/sys_info.py Wed Sep 21 11:51:44 2011
@@ -1,0 +1,37 @@
+###############################################################################
+#                                                                            
 #
+# Copyright (C) 2011 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 for displaying system information."""
+
+# relax module imports.
+from info import Info_box
+
+
+def sys_info():
+    """Display the system information."""
+
+    # Initialise the info box.
+    info = Info_box()
+
+    # Print all info.
+    print(info.sys_info())

Modified: 1.3/prompt/interpreter.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/interpreter.py?rev=14725&r1=14724&r2=14725&view=diff
==============================================================================
--- 1.3/prompt/interpreter.py (original)
+++ 1.3/prompt/interpreter.py Wed Sep 21 11:51:44 2011
@@ -61,6 +61,7 @@
 from reset import Reset
 from minimisation import Minimisation
 from model_selection import Modsel
+from sys_info import Sys_info
 from temperature import Temp
 
 # User classes.
@@ -172,8 +173,9 @@
         reset = Reset(self._exec_info)
         minimisation = Minimisation(self._exec_info)
         modsel = Modsel(self._exec_info)
+        opendx = OpenDX(self._exec_info)
+        sys_info = Sys_info(self._exec_info)
         temp = Temp(self._exec_info)
-        opendx = OpenDX(self._exec_info)
 
         # Place the user functions in the local namespace.
         objects['angle_diff_frame'] = angles.angle_diff_frame
@@ -184,6 +186,7 @@
         objects['reset'] = reset.reset
         objects['minimise'] = minimisation.minimise
         objects['model_selection'] = modsel.model_selection
+        objects['sys_info'] = sys_info.sys_info
         objects['temperature'] = temp.set
 
         # Place the user classes in the local namespace.

Added: 1.3/prompt/sys_info.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/sys_info.py?rev=14725&view=auto
==============================================================================
--- 1.3/prompt/sys_info.py (added)
+++ 1.3/prompt/sys_info.py Wed Sep 21 11:51:44 2011
@@ -1,0 +1,50 @@
+###############################################################################
+#                                                                            
 #
+# Copyright (C) 2011 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 Basic_class, _build_doc
+from generic_fns.sys_info import sys_info
+
+
+class Sys_info(Basic_class):
+    """Class containing the sys_info function."""
+
+    def sys_info(self):
+        # Function intro text.
+        if self._exec_info.intro:
+            text = self._exec_info.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)
+




Related Messages


Powered by MHonArc, Updated Wed Sep 21 12:20:02 2011