Discussion:
[Bitpim-devel] Joe: Exception in calendar
Roger Binns
2005-01-05 08:55:50 UTC
Permalink
Joe,

I get this exception when running without debug - ie python -OO bp.py
Since this is how BitPim is shipped ...

Traceback (most recent call last):
File "c:\python23\lib\site-packages\wx\_core.py", line 10673, in <lambda>
lambda event: event.callable(*event.args, **event.kw) )
File "c:\projects\bitpim\gui.py", line 876, in OnPopulateEverythingFromDisk
self.calendarwidget.getfromfs(results)
File "c:\projects\bitpim\bpcalendar.py", line 751, in getfromfs
calendarobjectfactory)
File "c:\projects\bitpim\database.py", line 261, in _transactionwrapper
return method(*args, **kwargs)
File "c:\projects\bitpim\database.py", line 596, in getmajordictvalues
record=factory.newdataobject()
File "c:\projects\bitpim\database.py", line 187, in newdataobject
return self.dataobjectclass(values)
File "c:\projects\bitpim\bpcalendar.py", line 147, in __init__
self.update(data.get_db_dict())
AttributeError: 'dict' object has no attribute 'get_db_dict'
Variables by last 8 frames, innermost last
Frame MainLoop in c:\python23\lib\site-packages\wx\_core.py at line 4732
args = (<gui.MainApp; proxy of C++ wxPyApp instance at _f0de8300_p_wxPyApp>,)
kwargs = Keys []
{}
Frame <lambda> in c:\python23\lib\site-packages\wx\_core.py at line 10673
event = <wx._core.PyEvent; proxy of C++ wxPyEvent instance at _30815402_p_wxPyEvent>
Frame OnPopulateEverythingFromDisk in c:\projects\bitpim\gui.py at line 889
self = <gui.MainWindow; proxy of C++ wxFrame instance at _e865be01_p_wxFrame>
results = Keys ['categories', 'phonebook', 'ringtone-index', 'wallpaper-index']
{'phonebook': {'a9b5a4e5402ebbe1e72ff3e146869cb5b7ed0546': {'serials': [{'serial
_ = None
Frame getfromfs in c:\projects\bitpim\bpcalendar.py at line 751
self = <bpcalendar.Calendar; proxy of C++ wxPanel instance at _90aafa01_p_wxPanel>
dict = Keys ['categories', 'phonebook', 'ringtone-index', 'wallpaper-index']
{'phonebook': {'a9b5a4e5402ebbe1e72ff3e146869cb5b7ed0546': {'serials': [{'serial
Frame _transactionwrapper in c:\projects\bitpim\database.py at line 280
cmd = 'END TRANSACTION'
success = False
self = <database.Database instance at 0x01B750F8>
args = (<database.Database instance at 0x01B750F8>, 'calendar', <database.dataobjectfac
w = False
kwargs = Keys []
{}
method = <function getmajordictvalues at 0x019B2330>
Frame getmajordictvalues in c:\projects\bitpim\database.py at line 596
uids = ['1c0df5ff858b0efc4eeeafec323e8f368099f093']
uid = 3
deleted = 2
res = Keys []
{}
self = <database.Database instance at 0x01B750F8>
indirects = Keys []
{}
factory = <database.dataobjectfactory instance at 0x01AB3990>
name = 'description'
colnum = 7
u = '1c0df5ff858b0efc4eeeafec323e8f368099f093'
tablename = 'calendar'
schema = [[0, '__rowid__', 'integer primary key'], [1, '__timestamp__', 'numeric'], [2, '
type = 'valueBLOB'
row = (1, 1104826813.859, None, '1c0df5ff858b0efc4eeeafec323e8f368099f093', 'calendar_
Frame newdataobject in c:\projects\bitpim\database.py at line 187
self = <database.dataobjectfactory instance at 0x01AB3990>
values = Keys []
{}
Frame __init__ in c:\projects\bitpim\bpcalendar.py at line 147
self = {}
data = Keys []
{}

Roger
Vic Heintz
2005-01-05 13:51:20 UTC
Permalink
Post by Roger Binns
Joe,
I get this exception when running without debug - ie python -OO bp.py
Since this is how BitPim is shipped ...
Not sure if this is related (it also involves database.py) but I am
getting an exception when changing wallpaper for a phonebook entry:

Traceback (most recent call last):
File "/Users/vic/Projects/bitpim/phonebook.py", line 653, in OnIdle
self.populatefs(self.getdata({}))
File "/Users/vic/Projects/bitpim/phonebook.py", line 873, in
populatefs
self.mainwindow.database.savemajordict("phonebook",
database.extractbitpimserials(dict["phonebook"]))
File "/Users/vic/Projects/bitpim/database.py", line 197, in
extractbitpimserials
res[record.GetBitPimSerial()]=record
AttributeError: 'dict' object has no attribute 'GetBitPimSerial'

Variables by last 8 frames, innermost last

Frame ? in /Users/vic/Projects/bitpim/bp.py at line 79
profile = <function profile at 0x10f4f0>
__file__ = '/Users/vic/Projects/bitpim/bp.py'
__name__ = '__main__'
__doc__ = 'Main entry point to Bitpim\n\nIt invokes BitPim in
gui or commandline mode as a

Frame run in /Users/vic/Projects/bitpim/gui.py at line 361
args = (['/Users/vic/Projects/bitpim/bp.py'],)
m = <gui.MainApp; proxy of C++ wxPyApp instance at
_0213c7d0_p_wxPyApp>

Frame MainLoop in
//Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-
packages/wx/_core.py at line 5262
self = <gui.MainApp; proxy of C++ wxPyApp instance at
_0213c7d0_p_wxPyApp>

Frame MainLoop in
//Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-
packages/wx/_core.py at line 4732
args = (<gui.MainApp; proxy of C++ wxPyApp instance at
_0213c7d0_p_wxPyApp>,)
kwargs = Keys []
{}

Frame OnIdle in /Users/vic/Projects/bitpim/phonebook.py at line 653
self = <phonebook.PhoneWidget; proxy of C++ wxPanel
instance at _03676890_p_wxPanel>
_ = <wx._core.IdleEvent; proxy of C++ wxIdleEvent
instance at _bfffecc0_p_wxIdleEven

Frame populatefs in /Users/vic/Projects/bitpim/phonebook.py at line 873
self = <phonebook.PhoneWidget; proxy of C++ wxPanel
instance at _03676890_p_wxPanel>
dict = Keys ['categories', 'phonebook']
{'phonebook': {0: {'serials': [{'serial2': '1',
'serial1': '1', 'sourcetype': 's

Frame extractbitpimserials in /Users/vic/Projects/bitpim/database.py at
line 197
record = Keys ['categories', 'names', 'numbers', 'ringtones',
'serials', 'urls', 'wallpapers']
{'serials': [{'serial2': '5', 'serial1': '40',
'sourcetype': 'scha670', 'sourceu
dict = Keys [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43]
{0: {'serials': [{'serial2': '1', 'serial1': '1',
'sourcetype': 'scha670', 'sour
res = Keys ['10dad00209a12b900cfb86e9206ddce9fbd50444',
'1e1cbbd10059d9f2fbcb68d564903dd6dda8607b',
'26006e3f82b7985711bc44e1d3342089a37dd04d',
'28e57098af9196d1d4120f8215e52afad2b803e6',
'2917e015efec7762c25b8642ab3b98f325285856',
'3300140d5e68d6031f945fcc61efeda20432c86b',
'3f2592bd5579e3728fcec4db192b0bcb0ba396f7',
'401e4d6d639a886f36081dd5de5e68d8f15d8a87',
'4b248f3e57dfdda239afef492d68644e8e22057c',
'4bdd0850e7fac265c1edd51d5d992caa49c042e1',
'508a8144c59ed54d9487b06dcf3d92990d3dda55',
'61868b1f9346e51329fb9523cff3321ce0cad4bb',
'62db5436ee035ecb59b33e2cd0cf22d29630cab5',
'62df1ff4bd5db5eb218cb4c771fa84eabdc657c1',
'64b190d60b787320c21f73191022cbc9cded9a99',
'64db44b1e317d285477415c8e6340c9f3f4efa7d',
'69c4b6c864ad054e268be17acf5c2441ba9dd368',
'6d6a446565f14e7058110a4dc9d6f18ae14e2ac8',
'6f90fb04b347938c5e6e7a9454eb9f5f9263084a',
'71d8be3485b84fd39884e950a2d481e0c1c9a583',
'7930e7d4096a88de6c1d91b91ed887f3691952f0',
'7ad46673901d69625903e6dd5ef0b506b9960cd6',
'803f446f3dde17891eaa2d14e0d527becc691e0c',
'813d446e7d08a9556add87f1b3c0c44d26fbd1a8',
'830b9a0cd163653b78d45a411610c4ae089417a4',
'a677902f72198d7480583686ea15a98d12d7ffd1',
'ad49cc563008aa28d140a70974cb85b45aadffcd',
'af4e51f4d620dd5e4b02f38676998645d08c9e5d',
'b4fa6c9a4a01135156b8fc9734e0978b87f6d8b5',
'c4a39e9d3111dca0475256a80a7ef809fd93fd3e',
'd0658ae1399570f0c4061c3ddf40addd3e631e8b',
'd62516a35df966ae0e30fd89517106aa36dca0d0',
'e2386aff8b2fc667c5e14255fda4af6a68cffdbf',
'e6c18c589e14af81f44725c4966e3960d6edc4b8',
'ec6d695414b4b1e7ef0bdef621481e4abc983190',
'f1f8d6e290df7e724b3df19d276e50fc2d1f2b5c',
'f622403ed8e9f733e58d3b133c667ee79a6f8a9f',
'f96e2ba27e1f6809e0f4141f98f04843527069be',
'ff9942a1ffb602f742d4a94a7a269487322c7ee7']
{'d62516a35df966ae0e30fd89517106aa36dca0d0':
{'serials': [{'serial2': '4', 'seri

Vic
Roger Binns
2005-01-06 05:59:01 UTC
Permalink
Post by Vic Heintz
Not sure if this is related (it also involves database.py) but I am
(BTW thank you *very* much for reporting these issues. You are very
good at finding bugs :-)

The issue was that changing anything via the phonebook entryeditor
caused a problem. It was because modifying an entry caused the
entryeditor to make a copy of the data passed in. The reason it
does this is so that if you hit cancel it hasn't munged the original
data.

The copy() method makes a new dict object, rather than whatever
class the item actually was. Until the new database work it was
always a dict anyway. Now it is a subclass with various extra
magic thrown in. Later on the code was accessing the now non-
existent magic ...

Roger
Vic Heintz
2005-01-05 14:08:06 UTC
Permalink
Post by Vic Heintz
Post by Roger Binns
Joe,
I get this exception when running without debug - ie python -OO bp.py
Since this is how BitPim is shipped ...
Not sure if this is related (it also involves database.py) but I am
Get a similar fatal exception when attempting to change the ringtone
for a phonebook entry.- Vic
d***@netzero.com
2005-01-05 16:49:24 UTC
Permalink
Thanks for the catch. I guess this would be a good thing to check myself before each build.

-Joe Pham



________________________________________________________________
NetZero Gift Certificates
Give the gift of Internet access this holiday season.
http://www.netzero.com/give
Vic Heintz
2005-01-06 07:23:42 UTC
Permalink
Post by Roger Binns
(BTW thank you *very* much for reporting these issues. You are very
good at finding bugs :-)
The issue was that changing anything via the phonebook entryeditor
caused a problem.
Glad I can help. Since you brought up the phonebook entryeditor. There
is a long standing bug there that I have so far avoided mentioning
because I have assumed it is probably a Jaguar-only wxpython issue. I
have not had much luck reporting things to that group.

That editor has a really ugly GUI (at least in Jaguar.) See the
attached screen grab. First of all, the phantom text appears at the
left side of the title bar as soon as the window comes up. The phantom
blue-outlined box in the upper left appears whenever you click on the
scroll bar. The scroll bar becomes non-functional until you drag the
corner of the window to force a redraw of the window. It takes several
repeats of these operations in order to manage to scroll through the
list. Both ringtone and wallpaper tabs have this problem.

Vic
Roger Binns
2005-01-06 07:41:26 UTC
Permalink
Post by Vic Heintz
That editor has a really ugly GUI (at least in Jaguar.) See the
attached screen grab.
That definitely doesn't happen on Windows or Linux. It looks like
you are getting text from the listbox being drawn in the wrong place
occasionally. Not much I can do about that.

The item in the left hand side is based on wx.Html. I am planning
on replacing that with a custom control since it won't have all
the horrible issues of wx.Html.

Roger

Loading...