mailr28205 - in /trunk: gui/ lib/ pipe_control/ user_functions/


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

Header


Content

Posted by edward on May 12, 2016 - 10:04:
Author: bugman
Date: Thu May 12 10:04:01 2016
New Revision: 28205

URL: http://svn.gna.org/viewcvs/relax?rev=28205&view=rev
Log:
Fix for the independence of the relax library.

As lib.system was using the status object, the library independence was 
broken.  To work around
this, the module has simply been shifted into the pipe_control package.


Added:
    trunk/pipe_control/system.py
      - copied unchanged from r28204, trunk/lib/system.py
Removed:
    trunk/lib/system.py
Modified:
    trunk/gui/relax_gui.py
    trunk/lib/__init__.py
    trunk/pipe_control/__init__.py
    trunk/user_functions/sys_info.py

Modified: trunk/gui/relax_gui.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/gui/relax_gui.py?rev=28205&r1=28204&r2=28205&view=diff
==============================================================================
--- trunk/gui/relax_gui.py      (original)
+++ trunk/gui/relax_gui.py      Thu May 12 10:04:01 2016
@@ -2,6 +2,7 @@
 #                                                                            
 #
 # Copyright (C) 2009 Michael Bieri                                           
 #
 # Copyright (C) 2010-2016 Edward d'Auvergne                                  
 #
+# Copyright (C) 2016 Troels Schwartz-Linnet                                  
 #
 #                                                                            
 #
 # This file is part of the program relax (http://www.nmr-relax.com).         
 #
 #                                                                            
 #
@@ -58,10 +59,10 @@
 from info import Info_box
 from lib.errors import RelaxNoPipeError
 from lib.io import io_streams_restore
-from lib.system import pwd
 from pipe_control import state
 from pipe_control.pipes import cdp_name
 from pipe_control.reset import reset
+from pipe_control.system import pwd
 from status import Status; status = Status()
 from version import version
 

Modified: trunk/lib/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/__init__.py?rev=28205&r1=28204&r2=28205&view=diff
==============================================================================
--- trunk/lib/__init__.py       (original)
+++ trunk/lib/__init__.py       Thu May 12 10:04:01 2016
@@ -58,7 +58,6 @@
     'spectrum',
     'statistics',
     'structure',
-    'system',
     'text',
     'timing',
     'warnings',

Removed: trunk/lib/system.py
URL: http://svn.gna.org/viewcvs/relax/trunk/lib/system.py?rev=28204&view=auto
==============================================================================
--- trunk/lib/system.py (original)
+++ trunk/lib/system.py (removed)
@@ -1,78 +0,0 @@
-###############################################################################
-#                                                                            
 #
-# Copyright (C) 2016 Troels Schwartz-Linnet                                  
 #
-#                                                                            
 #
-# This file is part of the program relax (http://www.nmr-relax.com).         
 #
-#                                                                            
 #
-# This program 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 3 of the License, or          
 #
-# (at your option) any later version.                                        
 #
-#                                                                            
 #
-# This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.      
 #
-#                                                                            
 #
-###############################################################################
-
-# Module docstring.
-"""Module for various os and sys python module purposes."""
-
-# Python module imports.
-from os import chdir, getcwd
-
-# relax module imports.
-import lib.arg_check
-from status import Status; status = Status()
-
-
-def cd(path, verbose=False):
-    """The equivalent of python module os.chdir(path).  Change the current 
working directory to the specified path.
-
-    @keyword verbose:  A flag which if True will cause the previous 
directory to be printed.
-    @type verbose:     bool
-    @param path:       The path to the directory for the current working 
directory.
-    @type  path:       str
-    """
-
-    # Check that the path is a string.
-    lib.arg_check.is_str(path, name="path", can_be_none=False, 
raise_error=True)
-
-    # Replace any remains of " and '
-    path = path.replace('"', '').replace("'", "")
-
-    # Print previous current working directory.
-    if verbose:
-        print("The current working directory was: %s"%getcwd())
-
-    # Change the current working directory.
-    chdir(path)
-
-    # Print current working directory.
-    print("The current working directory is now changed to: %s"%getcwd())
-
-    # Notify observers that the current working directory has changed.
-    status.observers.system_cwd_path.notify()
-
-
-def pwd(verbose=True):
-    """Print and return string of the current working directory.  Equivalent 
of python module os.getcwd(). 
-
-    @keyword verbose:   A flag which if True will cause the current 
directory to be printed.
-    @type verbose:      bool
-    @return:            Path to the current working directory.
-    @rtype:             str
-    """
-
-    # Get the current working directory.
-    cwd = getcwd()
-
-    # Print previous current working directory.
-    if verbose:
-        print("The current working directory is: %s"%cwd)
-
-    return cwd

Modified: trunk/pipe_control/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/__init__.py?rev=28205&r1=28204&r2=28205&view=diff
==============================================================================
--- trunk/pipe_control/__init__.py      (original)
+++ trunk/pipe_control/__init__.py      Thu May 12 10:04:01 2016
@@ -64,6 +64,7 @@
     'state',
     'statistics',
     'structure',
+    'system',
     'value',
     'vmd'
 ]

Modified: trunk/user_functions/sys_info.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/user_functions/sys_info.py?rev=28205&r1=28204&r2=28205&view=diff
==============================================================================
--- trunk/user_functions/sys_info.py    (original)
+++ trunk/user_functions/sys_info.py    Thu May 12 10:04:01 2016
@@ -1,6 +1,7 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2011-2014 Edward d'Auvergne                                  
 #
+# Copyright (C) 2011-2016 Edward d'Auvergne                                  
 #
+# Copyright (C) 2016 Troels Schwartz-Linnet                                  
 #
 #                                                                            
 #
 # This file is part of the program relax (http://www.nmr-relax.com).         
 #
 #                                                                            
 #
@@ -33,8 +34,8 @@
 # relax module imports.
 from graphics import WIZARD_OXYGEN_PATH
 from info import print_sys_info
-from lib.system import cd, pwd
 from lib.timing import print_time
+from pipe_control.system import cd, pwd
 from user_functions.data import Uf_info; uf_info = Uf_info()
 from user_functions.objects import Desc_container
 




Related Messages


Powered by MHonArc, Updated Thu May 12 10:20:04 2016