Discussion:
[Bitpim-devel] wxPython 2.5 update
Roger Binns
2004-08-27 05:36:23 UTC
Permalink
The upgrade is pretty much complete. The only thing I have left to
do is make sizers come up with a sensible size initially in some
Windows.

As a bonus, the code should work with both Unicode and non-Unicode
versions of wxPython. (In the latter case, non-ascii characters
that are encountered are turned into question marks.)

I would like to hear feedback from Linux and Mac users especially.
On Linux I would prefer to use GTK2, which by default uses
Unicode.

I am still undecided about what to do on the Unicode side. Eventually
we will have to move to it, just to support machines in different
locales as well as users from other countries. Now may be
as good a time as any to do that move.

I am thinking of doing a build this weekend.

Roger
Peter Pletcher
2004-08-27 20:48:45 UTC
Permalink
A couple quick things -

I'm now using wx 2.5 built for GTK2. It really is '1 better' than GTK
:)

My friend's crazy last name made me encounter different character sets
in vcards. Patch to handle the CHARSET= parameter in a vcard is
attached. Roger, you rock for tackling the unicode thing now. What
will happen when I send this to my phone (LG VX4500)?

Seems that Evolution doesn't include the CHARSET param (but uses a
different character set!) via the exporter tool. :( But it includes
the param when saving a vcard. What fun!

Also, apparently GetGridCursorRow() returns -1 if it cannot find the
row (say, if there *are* none.) This happens in the second import
dialog when I hide all the merge types (uncheck all of 'Show entries')

The traceback:
An unexpected exception has occurred.
Please see the help for details on what to do.

Traceback (most recent call last):
File "/home/peterp/bitpim/bitpim/phonebook.py", line 1612, in
OnCheckbox
self.table.OnDataUpdated()
File "/home/peterp/bitpim/bitpim/phonebook.py", line 1391, in
OnDataUpdated
self.main.OnCellSelect()
File "/home/peterp/bitpim/bitpim/phonebook.py", line 1707, in
OnCellSelect
row=self.table.GetRowData(self.grid.GetGridCursorRow())
File "/home/peterp/bitpim/bitpim/phonebook.py", line 1124, in
GetRowData
return self.main.rowdata[self.rowkeys[row]]
IndexError: list index out of range

Variables by last 8 frames, innermost last

Frame __call__ in /home/peterp/bitpim/bitpim/gui.py at line 360
self = <gui.MenuCallback instance at 0x41ef1eac>
args = (<wx._core.CommandEvent; proxy of C++ wxCommandEvent
instance at _f0d2ffbf_p_wxC

Frame OnFileImportVCards in /home/peterp/bitpim/bitpim/importexport.py
at line 1328
path = u'/home/peterp/Jen.vcf'
dlg = wxPython wrapper for DELETED ImportVCardDialog
object! (The C++ object no longer
data = {0: {'serials': [{'uid':
u'pas-id-412B247C00000015'}], 'addresses': [{'city': u'
parent = <gui.MainWindow; proxy of C++ wxFrame instance at
_586fec08_p_wxFrame>

Frame importdata in /home/peterp/bitpim/bitpim/phonebook.py at line 870
dlg = <phonebook.ImportDialog; proxy of C++ wxDialog
instance at _506a7708_p_wxDialog>
d = {0: {'serials': [{'folderid': '<Evolution
Addressbook Exporter>', 'sourcetype':
self = <phonebook.PhoneWidget; proxy of C++ wxPanel
instance at _70c8a808_p_wxPanel>
merge = True
importdata = {0: {'serials': [{'uid':
u'pas-id-412B247C00000015'}], 'addresses': [{'city': u'
categoriesinfo = []
result = None

Frame ShowModal in /usr/lib/python2.3/site-packages/wx/_windows.py at
line 580
args = (<phonebook.ImportDialog; proxy of C++ wxDialog
instance at _506a7708_p_wxDialog
kwargs = {}

Frame OnCheckbox in /home/peterp/bitpim/bitpim/phonebook.py at line
1612
c = <wx._controls.CheckBox; proxy of C++ wxCheckBox
instance at _501c6108_p_wxCheckB
self = <phonebook.ImportDialog; proxy of C++ wxDialog
instance at _506a7708_p_wxDialog>
vclist = ((0, <wx._controls.CheckBox; proxy of C++ wxCheckBox
instance at _a0bb7408_p_wxC
t = <class 'phonebook.ImportDataTable'>
v = 3
_ = <wx._core.CommandEvent; proxy of C++ wxCommandEvent
instance at _c0b4ffbf_p_wxCo

Frame OnDataUpdated in /home/peterp/bitpim/bitpim/phonebook.py at line
1391
sortcolumn = 1
newkeys = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 2
c = 'Memo5'
colsused = ['Confidence']
ln = 0
items = []
k = 22
n = 22
colsavail = ['Name', 'Categories', 'Home', 'Home2', 'Home3',
'Office', 'Office2', 'Office3',
lo = 23
msg = <wx.grid.GridTableMessage; proxy of C++
wxGridTableMessage instance at _403e7208
self = <phonebook.ImportDataTable; proxy of C++
wxPyGridTableBase instance at _00cc7f08
oldrows = [9, 18, 11, 13, 17, 20, 15, 19, 21, 5, 6, 10, 8, 12,
22, 7, 3, 4, 14, 0, 2, 16,

Frame OnCellSelect in /home/peterp/bitpim/bitpim/phonebook.py at line
1707
self = <phonebook.ImportDialog; proxy of C++ wxDialog
instance at _506a7708_p_wxDialog>
event = None

Frame GetRowData in /home/peterp/bitpim/bitpim/phonebook.py at line
1124
self = <phonebook.ImportDataTable; proxy of C++
wxPyGridTableBase instance at _00cc7f08
row = -1
Roger Binns
2004-08-27 22:02:01 UTC
Permalink
Post by Peter Pletcher
attached. Roger, you rock for tackling the unicode thing now. What
will happen when I send this to my phone (LG VX4500)?
I have no idea. I think there will be an encoding error. Could
you munge the vcard to exclude real personal information so that
I can add it to the ones in examples/vcards.vcf which I use for
testing.

I'll use my sacrificial VX6000 to see what happens. I do expect some
phone models may crash or do other stupid things with the high bit
set.

I am busy looking for code that can convert unicode data to a
pleasant form of ascii. This has been the best I found so
far:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/251871
Post by Peter Pletcher
Also, apparently GetGridCursorRow() returns -1 if it cannot find the
row (say, if there *are* none.) This happens in the second import
dialog when I hide all the merge types (uncheck all of 'Show entries')
I wil be fixing this after 0.7.17. The intention with .17 is that the
only change is the wxPython version. When (no if :-) users report
issues, they can compare .16 and .17 to let us know if the issue
is with wxPython, or a genuine bug.

Thanks,

Roger
Roger Binns
2004-09-02 02:56:27 UTC
Permalink
Post by Peter Pletcher
My friend's crazy last name made me encounter different character sets
in vcards. Patch to handle the CHARSET= parameter in a vcard is
attached. Roger, you rock for tackling the unicode thing now. What
will happen when I send this to my phone (LG VX4500)?
I've committed the patch. Please can you send me some sample vcards
that (ab)use charset including what Evolution is doing so that I
can add them to examples/vcards.vcf.
Post by Peter Pletcher
Also, apparently GetGridCursorRow() returns -1 if it cannot find the
row (say, if there *are* none.) This happens in the second import
dialog when I hide all the merge types (uncheck all of 'Show entries')
I have just committed the fix for that as well.

Roger

Loading...