mailRe: [sr #3117] Functionality to inspect interactively after running script - The equivalence to python -i


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

Header


Content

Posted by Troels Emtekær Linnet on February 13, 2014 - 17:00:
Hi Edward.

In interpreter.py I have a problem.

-----------------
    # Quit relax.
    # FIXME: need to drop off end of interpreter loop to exit cleanly
    #if quit:
    #    sys.exit()
-------------

I have tried tried to set the Quit flag to False, but it seems it is not in use?

So I can't find what causes relax to quit after running the script.

Best
Troels



2014-02-13 12:59 GMT+01:00 Edward d'Auvergne <edward@xxxxxxxxxxxxx>:
Hi Troels,

Such functionality would be great!  The option '-i' is already used
though for the system information printout.  Do you have an
alternative suggestion?  Maybe:

-c, --continue    Execute the given script and continue into the
prompt mode to allow for interactive inspection.
-p, --prompt      Execute the given script and continue into the
prompt mode to allow for interactive inspection (this will require
changing the -p, --pedantic flag, which is not an issue).

I like the second as it is more logical.  What would your suggestions be?

As for an implementation, this should not be too hard.  Actually, it
should be rather trivial by just launching into the prompt mode with
the script as an argument, and then running the script inside the
prompt.interpreter.Interpreter.run() method.  Look at that method and
you'll see that implementing this feature should be a patch of less
than 10 lines!  Just that file and the base 'relax.py' file for adding
a new option and passing the script name in should be sufficient.

Regards,

Edward

On 13 February 2014 12:47, Troels E. Linnet
<NO-REPLY.INVALID-ADDRESS@xxxxxxx> wrote:
> URL:
>   <http://gna.org/support/?3117>
>
>                  Summary: Functionality to inspect interactively after running
> script - The equivalence to python -i
>                  Project: relax
>             Submitted by: tlinnet
>             Submitted on: Thu 13 Feb 2014 11:47:57 AM UTC
>                 Category: None
>                 Priority: 5 - Normal
>                 Severity: 1 - Wish
>                   Status: Need Info
>              Assigned to: None
>         Originator Email:
>              Open/Closed: Open
>          Discussion Lock: Any
>         Operating System: None
>
>     _______________________________________________________
>
> Details:
>
> I would be of interest ti have an option: relax -i script.py
>
> It should be the equivalence to the functionality: python -i script.py
>
> At the moment, such a possibility is reached by:
> relax
> script("script.py")
>
> But here one can only access the relax data containers.
> Any defined variables in the script is not reached.
>
>
>
>
>
>
>
>
>     _______________________________________________________
>
> Reply to this item at:
>
>   <http://gna.org/support/?3117>
>
> _______________________________________________
>   Message sent via/by Gna!
>   http://gna.org/
>
>
> _______________________________________________
> relax (http://www.nmr-relax.com)
>
> This is the relax-devel mailing list
> relax-devel@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-devel


Related Messages


Powered by MHonArc, Updated Thu Feb 13 17:20:14 2014