mailr28187 - /trunk/lib/system.py


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

Header


Content

Posted by tlinnet on April 02, 2016 - 17:05:
Author: tlinnet
Date: Sat Apr  2 17:05:45 2016
New Revision: 28187

URL: http://svn.gna.org/viewcvs/relax?rev=28187&view=rev
Log:
Adding af verbose flag to lib.system.pwd() function.

Modified:
    trunk/lib/system.py

Modified: trunk/lib/system.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/system.py?rev=28187&r1=28186&r2=28187&view=diff
==============================================================================
--- trunk/lib/system.py (original)
+++ trunk/lib/system.py Sat Apr  2 17:05:45 2016
@@ -29,9 +29,11 @@
 import lib.arg_check
 
 
-def cd(path):
+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
     """
@@ -43,7 +45,8 @@
     path = path.replace('"', '').replace("'", "")
 
     # Print previous current working directory.
-    print("The current working directory was: %s"%getcwd())
+    if verbose:
+        print("The current working directory was: %s"%getcwd())
 
     # Change the current working directory.
     chdir(path)




Related Messages


Powered by MHonArc, Updated Sat Apr 02 17:20:04 2016