mailr28184 - /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 - 15:59:
Author: tlinnet
Date: Sat Apr  2 15:59:42 2016
New Revision: 28184

URL: http://svn.gna.org/viewcvs/relax?rev=28184&view=rev
Log:
Adding a verbose True/False for the 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=28184&r1=28183&r2=28184&view=diff
==============================================================================
--- trunk/lib/system.py (original)
+++ trunk/lib/system.py Sat Apr  2 15:59:42 2016
@@ -52,9 +52,11 @@
     print("The current working directory is now changed to: %s"%getcwd())
 
 
-def pwd():
+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
     """
@@ -63,6 +65,7 @@
     cwd = getcwd()
 
     # Print previous current working directory.
-    print("The current working directory is: %s"%cwd)
+    if verbose:
+        print("The current working directory is: %s"%cwd)
 
     return cwd




Related Messages


Powered by MHonArc, Updated Sat Apr 02 16:20:06 2016