ouilles / pyscripter

Automatically exported from code.google.com/p/pyscripter
0 stars 0 forks source link

Would like finer control over tracing into modules #510

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.import a module like turtle
2.single stepping into a call, or starting program execution with the F7 key 
automatically opens and steps into turtle.py

Please provide any additional information below.

There is a partial solution, but it involves some black magic:  

__import__("turtle.py").__traceable__ = False

which, after execution is complete, prevents stepping into the named module.  
However, if you just start your program running with F7, you'll end up in the 
imported module before you can turn its tracing flag off.

One can also remove the source code (ha - you can't step into source if it 
doesn't exist) - but this is an ugly solution, and doesn't work unless you 
remove all source.  For example, if I rename turtle.py so the source is not 
found, I end up stepping into parts of tkinter instead!

I'd prefer the behaviour to be configurable in the IDE, perhaps with three 
options:

  a) Automatically open modules that one tries to step into, (current behaviour) 

  b) Only trace into modules that are already open in PyScripter, (the option I'd prefer to use for teaching purposes - they never open automatically, but if you want to step through some library module, just open it first in PyScripter)

  c) Prompt me before auto-opening and stepping into a module. (Maybe some would like a compromise middle policy!)

Original issue reported on code.google.com by p.wentwo...@ict.ru.ac.za on 25 May 2011 at 6:26

GoogleCodeExporter commented 9 years ago
You can put statements such as 

__import__("turtle.py").__traceable__ = False

in  python_init.py

See http://pyscripter.blogspot.com/2010/10/python-engine-initialization.html 
for details

Original comment by pyscripter on 29 May 2011 at 12:49

GoogleCodeExporter commented 9 years ago
Issue 479 has been merged into this issue.

Original comment by pyscripter on 14 Jun 2011 at 11:11

GoogleCodeExporter commented 9 years ago
Issue 479 has been merged into this issue.

Original comment by pyscripter on 21 Sep 2011 at 12:04