mailr22187 - /trunk/prompt/interpreter.py


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

Header


Content

Posted by tlinnet on February 14, 2014 - 12:13:
Author: tlinnet
Date: Fri Feb 14 12:13:05 2014
New Revision: 22187

URL: http://svn.gna.org/viewcvs/relax?rev=22187&view=rev
Log:
Finished implementing the functionality of interacting with variables after 
executing a script.

Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect 
interactively after running script - The equivalence to python -i

For getting access to variables after executing a script, the variable should 
be saved under: cdp.X, where X define a container.
The name space issue is discussed in: 
http://thread.gmane.org/gmane.science.nmr.relax.devel/5012

Modified:
    trunk/prompt/interpreter.py

Modified: trunk/prompt/interpreter.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/prompt/interpreter.py?rev=22187&r1=22186&r2=22187&view=diff
==============================================================================
--- trunk/prompt/interpreter.py (original)
+++ trunk/prompt/interpreter.py Fri Feb 14 12:13:05 2014
@@ -266,12 +266,17 @@
             readline.parse_and_bind("tab: complete")
 
         # Execute the script file if given.
-        if script_file:
+        if script_file and not status.prompt:
             # Turn on the user function intro flag.
             status.uf_intro = True
 
             # Run the script.
             return run_script(intro=self.__intro_string, local=locals(), 
script_file=script_file, show_script=self.__show_script, 
raise_relax_error=self.__raise_relax_error)
+
+        # Execute the script and go into prompt if the interactive flag -p 
--prompt is given at startup.
+        if script_file and status.prompt:
+            run_script(intro=self.__intro_string, local=locals(), 
script_file=script_file, show_script=self.__show_script, 
raise_relax_error=self.__raise_relax_error)
+            prompt(intro=None, local=locals())
 
         # Go to the prompt.
         else:




Related Messages


Powered by MHonArc, Updated Fri Feb 14 12:40:03 2014