This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: implementation of Text.dump method
Type: Stage:
Components: Tkinter Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: gvanrossum Nosy List: gvanrossum, johnw42, loewis, tim.peters
Priority: low Keywords: patch

Created on 2002-04-19 18:10 by johnw42, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
patch.diff johnw42, 2002-04-19 18:10 patch for Tkinter.py
patch2.diff johnw42, 2002-04-22 19:06 corrected patch for Tkinter.py
Messages (5)
msg39659 - (view) Author: John Williams (johnw42) Date: 2002-04-19 18:10
This is a fairly robust implementation of the dump
command for the text widget. It supports all the
options of the underlying Tk command. This patch is
relative to version 2.2.1.
msg39660 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-04-22 18:07
Logged In: YES 
user_id=6380

A quick test suggets that you don't parse the dump output
correctly. I entered "The quick brown fox jumps over the
lazy dog.\n" into a text widget, and then called
t.dump("1.0", "2.0"). It returned the following garbage:

[('text', '{The', 'quick'), ('brown', 'fox', 'jumps'),
('over', 'the', 'lazy'), ('dog.}', '1.0', 'mark'),
('current', '1.44', 'mark'), ('anchor', '1.44', 'mark'),
('insert', '1.44', 'text'), ('{', '}', '1.44')]

It looks like you don't parse the curly braces at all.

Maybe you can find someone on c.l.py to help you fix this?
msg39661 - (view) Author: John Williams (johnw42) Date: 2002-04-22 19:06
Logged In: YES 
user_id=44174

What an embarassing mistake! I've attached a new version
that uses a callback function to build the result list
instead of trying to parse a string with Tcl quoting in it.
It seems to work correctly when there are spaces and other
magic characters in the results.
msg39662 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2004-03-21 19:57
Logged In: YES 
user_id=31435

Guido, care to try this again?  Looks like you're the only one 
to try in 2 years!
msg39663 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-08-19 11:41
Logged In: YES 
user_id=21627

Guido had already committed this as Tkinter.py 1.162, on
2002/04/23. Closing it as accepted.
History
Date User Action Args
2022-04-10 16:05:14adminsetgithub: 36474
2002-04-19 18:10:48johnw42create