mailr10321 - /1.3/prompt/interpreter.py


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

Header


Content

Posted by edward on January 25, 2010 - 19:11:
Author: bugman
Date: Mon Jan 25 19:11:25 2010
New Revision: 10321

URL: http://svn.gna.org/viewcvs/relax?rev=10321&view=rev
Log:
Update the user function print out functions.

_off() and _on() are no longer private, and accept the verbose keyword arg to 
allow the print out to
be suppressed.


Modified:
    1.3/prompt/interpreter.py

Modified: 1.3/prompt/interpreter.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/interpreter.py?rev=10321&r1=10320&r2=10321&view=diff
==============================================================================
--- 1.3/prompt/interpreter.py (original)
+++ 1.3/prompt/interpreter.py Mon Jan 25 19:11:25 2010
@@ -212,8 +212,8 @@
         objects['vmd'] = Vmd(self.exec_info)
 
         # Builtin interpreter functions.
-        objects['intro_off'] = self._off
-        objects['intro_on'] = self._on
+        objects['intro_off'] = self.off
+        objects['intro_on'] = self.on
         objects['exit'] = objects['bye'] = objects['quit'] = objects['q'] = 
_Exit()
         objects['script'] = self.script
 
@@ -268,18 +268,32 @@
             prompt(intro=self.__intro_string, local=locals())
 
 
-    def _off(self):
-        """Function for turning the function introductions off."""
+    def off(self, verbose=True):
+        """Turn the function introductions off.
+
+        @keyword verbose:   A flag which when True results in a print out 
message being displayed.
+        @type verbose:      bool
+        """
 
         self.exec_info.intro = False
-        print("Echoing of user function calls has been disabled.")
-
-
-    def _on(self):
-        """Function for turning the function introductions on."""
+
+        # Print out.
+        if verbose:
+            print("Echoing of user function calls has been disabled.")
+
+
+    def on(self, verbose=True):
+        """Turn the function introductions on.
+
+        @keyword verbose:   A flag which when True results in a print out 
message being displayed.
+        @type verbose:      bool
+        """
 
         self.exec_info.intro = True
-        print("Echoing of user function calls has been enabled.")
+
+        # Print out.
+        if verbose:
+            print("Echoing of user function calls has been enabled.")
 
 
     def script(self, file=None, quit=False):




Related Messages


Powered by MHonArc, Updated Mon Jan 25 19:20:02 2010