Hi Troels,

This behaviour was introduced to allow for nested scripting.  Maybe it
is not needed.  You can see it in the file prompt/interpreter.py
within the exec_script() function.  Feel free to play around with it,
but be prepared for some rather large test suite breakages.  A fix
will probably not be trivial.

Regards,

Edward



On 1 May 2014 11:46, Troels E. Linnet <[email protected]> wrote:
> URL:
>   <http://gna.org/bugs/?22001>
>
>                  Summary: The execution of script changes current working
> directory
>                  Project: relax
>             Submitted by: tlinnet
>             Submitted on: Thu 01 May 2014 09:46:51 AM UTC
>                 Category: None
> Specific analysis category: None
>                 Priority: 7 - High
>                 Severity: 4 - Important
>                   Status: None
>              Assigned to: None
>          Originator Name:
>         Originator Email:
>              Open/Closed: Open
>                  Release: Repository: trunk
>          Discussion Lock: Any
>         Operating System: None
>
>     _______________________________________________________
>
> Details:
>
> This illustrates the problem
>
> tlinnet@linmac:~$ mkdir test ; cd test
> tlinnet@linmac:test$ mkdir script
> tlinnet@linmac:test$ echo "import os" >> script/test.py
> tlinnet@linmac:test$ echo "print(os.getcwd())" >> script/test.py
> tlinnet@linmac:test$ relax script/test.py
>
>
>
>                                   relax repository checkout rNone
>                                                 None
>
>                               Molecular dynamics by NMR data analysis
>
>                              Copyright (C) 2001-2006 Edward d'Auvergne
>                          Copyright (C) 2006-2014 the relax development team
>
> This is free software which you are welcome to modify and redistribute under
> the conditions of the
> GNU General Public License (GPL).  This program, including all modules, is
> licensed under the GPL
> and comes with absolutely no warranty.  For details type 'GPL' within the
> relax prompt.
>
> Assistance in using the relax prompt and scripting interface can be accessed
> by typing 'help' within
> the prompt.
>
> Processor fabric:  Uni-processor.
>
> script = 'script/test.py'
> ----------------------------------------------------------------------------------------------------
> import os
> print(os.getcwd())
> ----------------------------------------------------------------------------------------------------
> /Users/tlinnet/test/script
>
>
>
> ----------
>
> This means that running:
>
> relax $HOME/software/relax_trunk/sample_scripts/relax_disp/cpmg_analysis.py
>
> puts the output data inside "sample_scripts" instead of the current working
> folder.
>
> This behaviour is not expected.
>
>
>
>
>     _______________________________________________________
>
> Reply to this item at:
>
>   <http://gna.org/bugs/?22001>
>
> _______________________________________________
>   Message sent via/by Gna!
>   http://gna.org/
>
>
> _______________________________________________
> relax (http://www.nmr-relax.com)
>
> This is the relax-devel mailing list
> [email protected]
>
> 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-devel

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

This is the relax-devel mailing list
[email protected]

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-devel

Reply via email to