---------- Forwarded message ----------
From:
<tlinnet@xxxxxxxxxxxxx>Date: 2014-02-14 11:22 GMT+01:00
Subject: r22184 - in /trunk: prompt/interpreter.py relax.py
To:
relax-commits@xxxxxxxAuthor: tlinnet
Date: Fri Feb 14 11:22:57 2014
New Revision: 22184
URL:
http://svn.gna.org/viewcvs/relax?rev=22184&view=rev
Log:
Modified the help text to explain that -p will launch relax in prompt mode after running any optionally supplied scripts.
Fix for sr #3117, (
https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i
This is to allow the -p --prompt option to be given without a script. relax should support this so that a user doesn't get too confused when
trying to start in prompt mode with the --prompt flag and support the --prompt argument without a script being supplied.
Modified:
trunk/prompt/interpreter.py
trunk/relax.py
Modified: trunk/prompt/interpreter.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/prompt/interpreter.py?rev=22184&r1=22183&r2=22184&view=diff
==============================================================================
--- trunk/prompt/interpreter.py (original)
+++ trunk/prompt/interpreter.py Fri Feb 14 11:22:57 2014
@@ -336,14 +336,18 @@
# Reverse the system path so that the script path is first.
sys.path.reverse()
- # Execute the script as a module.
- #if dep_check.runpy_module:
- # runpy.run_module(module, globals)
+ # Execute the script as a module if the inspect interactively prompt flag is not true.
+ if dep_check.runpy_module and not status.prompt:
+ runpy.run_module(module, globals)
+
+ # Execute the script as a module if the inspect interactively prompt flag is not true.
+ elif dep_check.runpy_module and not status.prompt:
+ runpy.run_module(module, globals)
# Allow scripts to run under Python <= 2.4.
- #else:
- # exec(compile(open(name).read(), name, 'exec'), globals)
- exec(compile(open(name).read(), name, 'exec'), globals)
+ else:
+ exec(compile(open(name).read(), name, 'exec'), globals)
+
finally:
# Switch back to the original working directory.
Modified: trunk/relax.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/relax.py?rev=22184&r1=22183&r2=22184&view=diff
==============================================================================
--- trunk/relax.py (original)
+++ trunk/relax.py Fri Feb 14 11:22:57 2014
@@ -215,7 +215,7 @@
# Only import the module in the test modes (to improve program start up speeds).
from test_suite.test_suite_runner import Test_suite_runner
- # Load the interpreter and turn intros on.
+ # Load the interpreter and turn intros on.launch relax in prompt mode after running any optionally supplied scripts
self.interpreter = interpreter.Interpreter(show_script=False, raise_relax_error=True)
self.interpreter.on()
@@ -280,7 +280,7 @@
parser.add_option('-t', '--tee', action="" type='string', dest='tee', help='tee relax output to stdout and the file LOG_FILE', metavar='LOG_FILE')
parser.add_option('-g', '--gui', action="" dest='gui', default=0, help='launch the relax GUI')
parser.add_option('-e', '--escalate', action="" dest='escalate', default=0, help='escalate all warnings to errors')
- parser.add_option('-p', '--prompt', action="" dest='prompt', default=0, help='execute the given script and continue into the prompt mode to allow for interactive inspection')
+ parser.add_option('-p', '--prompt', action="" dest='prompt', default=0, help='launch relax in prompt mode after running any optionally supplied scripts')
parser.add_option('--test', action="" dest='test', default=0, help='run relax in test mode')
parser.add_option('-x', '--test-suite', action="" dest='test_suite', default=0, help='execute the relax test suite')
parser.add_option('-s', '--system-tests', action="" dest='system_tests', default=0, help='execute the relax system/functional tests (part of the test suite)')
_______________________________________________
relax (
http://www.nmr-relax.com)
This is the relax-commits mailing list
relax-commits@xxxxxxx
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits