Message269697
In "debug = False+1', I presume the '+1' is just temporary.
The debug property and the clinic file refer to _tkinter.tkapp.get/settrace, which do not exist. Did you just forget to include that part? Or does 'preliminary' mean 'do not test yet'?
>>> import tkinter
>>> tkinter.debug
1
>>> import idlelib.idle
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "F:\Python\dev\36\lib\idlelib\idle.py", line 11, in <module>
idlelib.pyshell.main()
File "F:\Python\dev\36\lib\idlelib\pyshell.py", line 1553, in main
root = Tk(className="Idle")
File "F:\Python\dev\36\lib\tkinter\__init__.py", line 2018, in __init__
self.debug = debug
File "F:\Python\dev\36\lib\tkinter\__init__.py", line 2110, in debug
self.tk.settrace(trace)
AttributeError: '_tkinter.tkapp' object has no attribute 'settrace'
At least the error shows that the code works as far as written ;-).
I now understand 'larger customization ...' to mean supplying a trace function other than the default, to do something with 'cmd' other than just print it. For instance, one could record tcl commands in a file and later count the tcl function calls, much like python's trace does. To do that, I believe you could just replace 'def trace ... with
if iscallable(value):
trace = value
else:
def trace ...
+1 on adding this. The default trace would be useful for simple interaction, but less so for what I tried to do above, which is to trace a complete IDLE session. |
|
Date |
User |
Action |
Args |
2016-07-01 21:20:01 | terry.reedy | set | recipients:
+ terry.reedy, serhiy.storchaka |
2016-07-01 21:20:01 | terry.reedy | set | messageid: <1467408001.61.0.890613536483.issue27405@psf.upfronthosting.co.za> |
2016-07-01 21:20:01 | terry.reedy | link | issue27405 messages |
2016-07-01 21:20:01 | terry.reedy | create | |
|