mailr10668 - in /1.3: info.py intro.py prompt/interpreter.py


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

Header


Content

Posted by edward on February 05, 2010 - 17:54:
Author: bugman
Date: Fri Feb  5 17:54:15 2010
New Revision: 10668

URL: http://svn.gna.org/viewcvs/relax?rev=10668&view=rev
Log:
Renamed the intro.Intro_text class to info.Info_box.

This is used for introduction strings, but can be used at any point in relax 
as well.


Added:
    1.3/info.py
      - copied, changed from r10652, 1.3/intro.py
Removed:
    1.3/intro.py
Modified:
    1.3/prompt/interpreter.py

Copied: 1.3/info.py (from r10652, 1.3/intro.py)
URL: 
http://svn.gna.org/viewcvs/relax/1.3/info.py?p2=1.3/info.py&p1=1.3/intro.py&r1=10652&r2=10668&rev=10668&view=diff
==============================================================================
--- 1.3/intro.py (original)
+++ 1.3/info.py Fri Feb  5 17:54:15 2010
@@ -29,8 +29,8 @@
 
 
 
-class Intro_text:
-    """The introductory text container."""
+class Info_box:
+    """A container storing information about relax."""
 
     def __init__(self):
         """Create the program introduction text stings.

Removed: 1.3/intro.py
URL: http://svn.gna.org/viewcvs/relax/1.3/intro.py?rev=10667&view=auto
==============================================================================
--- 1.3/intro.py (original)
+++ 1.3/intro.py (removed)
@@ -1,92 +1,0 @@
-###############################################################################
-#                                                                            
 #
-# Copyright (C) 2003-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.
-"""Module containing the introductory text container."""
-
-# relax module imports.
-import dep_check
-from version import version
-
-
-
-class Intro_text:
-    """The introductory text container."""
-
-    def __init__(self):
-        """Create the program introduction text stings.
-
-        This class generates a container with the following objects:
-            - title:  The program title 'relax'
-            - version:  For example 'repository checkout' or '1.3.8'.
-            - desc:  The short program description.
-            - copyright:  A list of copyright statements.
-            - licence:  Text pertaining to the licencing.
-            - errors:  A list of import errors.
-        """
-
-        # Program name and version.
-        self.title = "relax"
-        self.version = version
-
-        # The relax website.
-        self.website = "http://nmr-relax.com";
-
-        # Program description.
-        self.desc = "Molecular dynamics by NMR data analysis"
-
-        # Long description
-        self.desc_long = "The program relax is designed for the study of the 
dynamics of proteins or other macromolecules though the analysis of 
experimental NMR data. It is a community driven project created by NMR 
spectroscopists for NMR spectroscopists. It supports exponential curve 
fitting for the calculation of the R1 and R2 relaxation rates, calculation of 
the NOE, reduced spectral density mapping, and the Lipari and Szabo 
model-free analysis."
-
-        # Copyright printout.
-        self.copyright = []
-        self.copyright.append("Copyright (C) 2001-2006 Edward d'Auvergne")
-        self.copyright.append("Copyright (C) 2006-2010 the relax development 
team")
-
-        # Program licence and help.
-        self.licence = "This is free software which you are welcome to 
modify and redistribute under the conditions of the GNU General Public 
License (GPL).  This program, including all modules, is licensed under the 
GPL and comes with absolutely no warranty.  For details type 'GPL' within the 
relax prompt."
-
-        # ImportErrors, if any.
-        self.errors = []
-        if not dep_check.C_module_exp_fn:
-            self.errors.append(dep_check.C_module_exp_fn_mesg)
-
-
-    def centre(self, string, width=100):
-        """Format the string to be centred to a certain number of spaces.
-
-        @param string:  The string to centre.
-        @type string:   str
-        @keyword width: The number of characters to centre to.
-        @type width:    int
-        @return:        The centred string with leading whitespace added.
-        @rtype:         str
-        """
-
-        # Calculate the number of spaces needed.
-        spaces = (width - len(string)) / 2
-
-        # The new string.
-        string = spaces * ' ' + string
-
-        # Return the new string.
-        return string

Modified: 1.3/prompt/interpreter.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/interpreter.py?rev=10668&r1=10667&r2=10668&view=diff
==============================================================================
--- 1.3/prompt/interpreter.py (original)
+++ 1.3/prompt/interpreter.py Fri Feb  5 17:54:15 2010
@@ -45,7 +45,7 @@
 from base_class import Exec_info
 from command import Ls, Lh, Ll, system
 from help import _Helper, _Helper_python
-from intro import Intro_text
+from info import Info_box
 if dep_check.readline_module:
     from tab_completion import Tab_completion
 
@@ -147,26 +147,26 @@
         else:
             width = 100
 
-        # Initialise the string and the intro class
+        # Initialise the string and the relax information box.
         string = ''
-        text = Intro_text()
+        info = Info_box()
 
         # Some new lines.
         intro_string = '\n\n\n'
 
         # Program name and version.
-        intro_string = intro_string + text.centre(text.title + ' ' + 
text.version, width) + '\n\n'
+        intro_string = intro_string + info.centre(info.title + ' ' + 
info.version, width) + '\n\n'
 
         # Program description.
-        intro_string = intro_string + text.centre(text.desc, width) + '\n\n'
+        intro_string = intro_string + info.centre(info.desc, width) + '\n\n'
 
         # Copyright printout.
-        for i in range(len(text.copyright)):
-            intro_string = intro_string + text.centre(text.copyright[i], 
width) + '\n'
+        for i in range(len(info.copyright)):
+            intro_string = intro_string + info.centre(info.copyright[i], 
width) + '\n'
         intro_string = intro_string + '\n'
 
         # Program licence and help (wrapped).
-        for line in wrap(text.licence, width):
+        for line in wrap(info.licence, width):
             intro_string = intro_string + line + '\n'
         intro_string = intro_string + '\n'
  
@@ -176,8 +176,8 @@
             intro_string = intro_string + line + '\n'
 
         # ImportErrors, if any.
-        for i in range(len(text.errors)):
-            intro_string = intro_string + '\n' + text.errors[i] + '\n'
+        for i in range(len(info.errors)):
+            intro_string = intro_string + '\n' + info.errors[i] + '\n'
 
         # Return the formatted text.
         return intro_string




Related Messages


Powered by MHonArc, Updated Fri Feb 05 18:20:01 2010