Author: bugman
Date: Mon Jan  7 18:15:09 2008
New Revision: 4450

URL: http://svn.gna.org/viewcvs/relax?rev=4450&view=rev
Log:
The script file is now passed into the interpreter run() method.

This change is like to break many things!!!


Modified:
    1.3/prompt/interpreter.py
    1.3/relax

Modified: 1.3/prompt/interpreter.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/interpreter.py?rev=4450&r1=4449&r2=4450&view=diff
==============================================================================
--- 1.3/prompt/interpreter.py (original)
+++ 1.3/prompt/interpreter.py Mon Jan  7 18:15:09 2008
@@ -137,14 +137,17 @@
         self._Vmd = Vmd(relax)
 
 
-    def run(self, quit=True):
+    def run(self, script_file=None, quit=True):
         """Run the python interpreter.
 
         The namespace of this function is the namespace seen inside the 
interpreter.  All user
         accessible functions, classes, etc, should be placed in this namespace.
 
-        @param quit:    If true, the default, then relax will exit after 
running this function.
-        @type quit:     bool
+        @param script_file: The script file to be executed.  For the 
interpreter mode, this should
+                            be left as None.
+        @type script_file:  None or str
+        @param quit:        If true, the default, then relax will exit after 
running this function.
+        @type quit:         bool
         """
 
         # Python modules.
@@ -219,12 +222,12 @@
         readline.parse_and_bind("tab: complete")
 
         # Execute the script file if given.
-        if self.relax.script_file:
+        if script_file:
             # Turn on the function intro flag.
             self.intro = 1
 
             # Run the script.
-            run_script(intro=self.relax.intro_string, local=self.local, 
script_file=self.relax.script_file, quit=quit)
+            run_script(intro=self.relax.intro_string, local=self.local, 
script_file=script_file, quit=quit)
 
         # Test for the dummy mode for generating documentation (then exit).
         elif hasattr(self.relax, 'dummy_mode'):

Modified: 1.3/relax
URL: 
http://svn.gna.org/viewcvs/relax/1.3/relax?rev=4450&r1=4449&r2=4450&view=diff
==============================================================================
--- 1.3/relax (original)
+++ 1.3/relax Mon Jan  7 18:15:09 2008
@@ -146,7 +146,7 @@
 
             # Run the interpreter.
             self.interpreter = interpreter.Interpreter(self)
-            self.interpreter.run()
+            self.interpreter.run(self.script_file)
 
         # Threading mode.
         elif mode == 'thread':


_______________________________________________
relax (http://nmr-relax.com)

This is the relax-commits mailing list
relax-commits@gna.org

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

Reply via email to