Author: bugman Date: Mon Jan 7 18:16:19 2008 New Revision: 4451 URL: http://svn.gna.org/viewcvs/relax?rev=4451&view=rev Log: Merged revisions 4449-4450 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/1.3 ........ r4449 | bugman | 2008-01-07 18:09:07 +0100 (Mon, 07 Jan 2008) | 5 lines Created a script containing the commands used in the system test for creating a model-free model. The system test executes the script instead of running the commands itself. ........ r4450 | bugman | 2008-01-07 18:15:09 +0100 (Mon, 07 Jan 2008) | 5 lines The script file is now passed into the interpreter run() method. This change is like to break many things!!! ........ Added: branches/N_state_model/test_suite/system_tests/scripts/create_m4.py - copied unchanged from r4450, 1.3/test_suite/system_tests/scripts/create_m4.py Modified: branches/N_state_model/ (props changed) branches/N_state_model/prompt/interpreter.py branches/N_state_model/relax branches/N_state_model/test_suite/system_tests/model_free.py Propchange: branches/N_state_model/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: branches/N_state_model/prompt/interpreter.py URL: http://svn.gna.org/viewcvs/relax/branches/N_state_model/prompt/interpreter.py?rev=4451&r1=4450&r2=4451&view=diff ============================================================================== --- branches/N_state_model/prompt/interpreter.py (original) +++ branches/N_state_model/prompt/interpreter.py Mon Jan 7 18:16:19 2008 @@ -139,14 +139,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. @@ -222,12 +225,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: branches/N_state_model/relax URL: http://svn.gna.org/viewcvs/relax/branches/N_state_model/relax?rev=4451&r1=4450&r2=4451&view=diff ============================================================================== --- branches/N_state_model/relax (original) +++ branches/N_state_model/relax Mon Jan 7 18:16:19 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': Modified: branches/N_state_model/test_suite/system_tests/model_free.py URL: http://svn.gna.org/viewcvs/relax/branches/N_state_model/test_suite/system_tests/model_free.py?rev=4451&r1=4450&r2=4451&view=diff ============================================================================== --- branches/N_state_model/test_suite/system_tests/model_free.py (original) +++ branches/N_state_model/test_suite/system_tests/model_free.py Mon Jan 7 18:16:19 2008 @@ -82,14 +82,11 @@ def test_create_m4(self): """Creating model m4 with parameters {S2, te, Rex} using model_free.create_model().""" - # Path of the files. - path = sys.path[-1] + '/test_suite/system_tests/data/model_free/S2_0.970_te_2048_Rex_0.149' - - # Read the sequence. - self.relax.interpreter._Sequence.read(file='noe.500.out', dir=path) - - # Select the model. - self.relax.interpreter._Model_free.create_model(model='m4', equation='mf_orig', params=['S2', 'te', 'Rex'], spin_id=None) + # Place the script file name into self.relax.script_file. + self.relax.script_file = 'test_suite/system_tests/scripts/create_m4.py' + + # Execute relax in script mode. + self.relax.interpreter.run(quit=False) # Alias the current data pipe. cdp = relax_data_store[relax_data_store.current_pipe]