From: Roger B. <ro...@ro...> - 2003-11-11 06:52:25
|
Patrick Tullmann wrote: > Appended below is small patch for phonebook.py. The first patch > (checking the indexes in PhoneDataTable.GetValue) seems to prevent an > infinite recursion of exceptions. I did a different change earlier. What is actually happening is that the grid thinks there are more rows than there actually are. It starts asking for non-existent ones which generate an exception. The exception dialog is a modal dialog (ie the ShowModal function starts a new message loop and doesn't return until the dialog is closed). The phonebook tries to display the next cell, and causes another exception which causes another modal exception dialog to appear etc. It isn't infinite - there will just be one exception per cell, but it is a reasonable approximation of infinity :-) A future enhancement I will need to do is to make new exceptions append to the existing dialog if it is visible rather than cause a new dialog to be displayed. The root cause was that the message to tell the grid that rows were deleted was being ignored. That was because it has to be told which rows were deleted, not just how many. The appending of rows worked fine however, so it just kept growing each time new entries were read in. I have now fixed the code to do the correct deletion and all works fine. I do however want to use a custom widget at some point. The grid does lots of nasty stuff I don't like. For example try pressing the arrow keys to see how broken that is. > The second patch is just because wxPython doesn't word-wrap its dialog > boxes, so I manually wrapped the long message. The "python way" > probably doesn't involve +='ing string constants... I do it all the time :-) The actual problem is that there isn't an auto-sizing word wrapping text widget in wxWindows. I did however find that the HTML widget will at least wrap its text, but it won't shrink or expand its size. Try the import dialog after selecting a file and resize the dialog, paying attention to the instructions at the top. Now, if anyone wants a little project then a self sizing HTML widget would be great. It shouldn't be too much work, and the wxPython community would be very grateful :-) Let me know if you or anyone else wants to tackle this. I would use it all over the place. > My phone is an LGVX4400, I'm running bitpim out of CVS (sync'd as of > AM Nov. 09), The public CVS servers are now synced every 5 hours with the main ones according to SourceForge. > on Linux (Debian/testing, 2.4.22 kernel). I've got > wxpython version 2.4.2.4, python 2.3, pyserial 2.0, and DSV 1.4.0. > I'm using the USB cable. On Linuxm, I use Redhat 8 which is the same versions as above except Python is 2.2. As that machine suffers from kernel panics when closing the USB serial device (a known kernel bug), I don't actually talk to the phone with it. I then use my dual boot XP/RH9 box for testing that actually involves the phone. > I'm really hoping the palm<->lg > sync stuff will let me migrate my contact info out of jpliot... The CSV import is coming on nicely. I am just working on code to display an entry (that is the right hand side in the main phone book tab). The idea is that the last part of the import process will work much like personal finance programs. It will show you what was supplied from the import, what record already existed, and the result. I also found a Python library function that makes working out matches a real cinch. Run experiments/matching.py to see it in action. According to the doc, a figure of 60 or greater should be considered a match. My first attempt is just going to convert each record to text and run that function. I suspect it will give pretty decent results. And if you want some real fun, turn on protocol logging, read from the phone and then press Ctrl-Alt-P while viewing the protocol log. Roger |