Discussion:
[BitPim-devel] Calendar Entry Editor
Stephen Wood
2005-01-28 20:10:26 UTC
Permalink
I am getting back to reviewing the calendar support for my Samsung and
the Sanyo phones. I am having trouble creating events with the
Calendar Entry Editor, both with 0.7.25-1 and the cvs. Is it supposed
to work?

What I do is click on a date in the calendar, and then select New. If
I make any changes to the default "New Event" that is put in the
editor, I can not save it. I get the exception:

Traceback (most recent call last):
File "calendarentryeditor.py", line 611, in OnSaveButton
AttributeError: 'NoneType' object has no attribute 'repeat'

because self.getcurrententry has apparantly returned NoneType.

Stephen
d***@netzero.com
2005-01-29 01:37:33 UTC
Permalink
I am having trouble creating events with the Calendar Entry Editor, >both with 0.7.25-1 and the cvs. Is it supposed to work?
It's supposed to work as far as I know. I just tested myself with the latest CVS load and it worked ok for me. Have not had any reports of such a problem either. Please post the exception log for further debug.

-Joe Pham



______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!
Stephen Wood
2005-01-29 03:52:10 UTC
Permalink
I don't think the exception log helps. It looks like a wx problem,
perhaps specific to Linux. in getcurrententry,
self.listbox.GetSelection() must be returning -1 so that
getcurrententry returns None instead of self.getentry(i). If I just
force getcurrententry to return self.getentry(0), then I can save the
entry I am editing. (Into the first entry of a given day of course)

What I notices is that as soon as I change something about a calendar
entry, the listbox goes grey.

Stephen

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

Traceback (most recent call last):
File "/home/saw/BITPIM/bitpim/calendarentryeditor.py", line 611, in
OnSaveButton
if entry.repeat is not None:
AttributeError: 'NoneType' object has no attribute 'repeat'

Variables by last 8 frames, innermost last

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

Frame run in /home/saw/BITPIM/bitpim/gui.py at line 428
args = (['./bp.py'],)
m = <gui.MainApp; proxy of C++ wxPyApp instance at
_6059ca08_p_wxPyApp>

Frame MainLoop in /usr/lib/python2.3/site-packages/wx/_core.py at line 5262
self = <gui.MainApp; proxy of C++ wxPyApp instance at
_6059ca08_p_wxPyApp>

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

Frame OnSaveButton in /home/saw/BITPIM/bitpim/calendarentryeditor.py at line 611
entry = None
self = <calendarentryeditor.Editor; proxy of C++ wxDialog
instance at _7846f208_p_wxDia
evt = <wx._core.CommandEvent; proxy of C++ wxCommandEvent
instance at _50c9ebbf_p_wxCo
res = 1
Roger Binns
2005-01-29 18:24:21 UTC
Permalink
Post by Stephen Wood
I don't think the exception log helps. It looks like a wx problem,
perhaps specific to Linux. in getcurrententry,
self.listbox.GetSelection() must be returning -1 so that
There is an issue with ComboBox (and ListBox IIRC) on non-Windows
platforms. When you construct them you can specify a list of strings
that go into them. You can then set what the value the combo/listbox
should have either as a string or by position. For non-Windows
platforms, if you specify that value as a string it will show
correctly. If you ask which item is selected (ie by number) then you
get -1. The underlying code does not search through the list of
strings and update the selected item id.

The correct fix for this is to either request the value back as a
string, or to set the initial value numerically, not as a string.

Roger
d***@netzero.com
2005-01-29 21:09:34 UTC
Permalink
Roger, thanks for the insight, I'll fix up the code.

-Joe Pham



______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!
d***@netzero.com
2005-01-30 03:17:09 UTC
Permalink
Stephen, does the first selection work, ie. when you select an existing event to edit?
What I notices is that as soon as I change something about a calendar >entry, the listbox goes grey.
That's to prevent users to select a different event while editing the current one.

-Joe Pham



______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!
Stephen Wood
2005-01-30 03:46:03 UTC
Permalink
Post by d***@netzero.com
Stephen, does the first selection work, ie. when you select an existing event to edit?
I can select it, but I can't save it once I make any change. I can't
save existing or new entries.

It works now because I have put in a hack that should be removed once
the correct way to do this is found.

Stephen
d***@netzero.com
2005-01-30 04:11:53 UTC
Permalink
Can you delete it once you selected it? What's your hack to make it work for you?

-Joe Pham



______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!
Stephen Wood
2005-01-30 04:25:37 UTC
Permalink
Post by d***@netzero.com
Can you delete it once you selected it? What's your hack to make it work for you?
I can delete something I select if I havn't changed something.
(Making the listbox go grey.)

In the hack (which is in the CVS), I cache the result of
self.listbox.GetSelection() everytime getcurrententry is called. If
GetSelection returns -1, then I used the cached index into the
listbox.

Stephen

def getcurrententry(self):
"""Returns the entry currently being viewed

@Note: this returns the unedited form of the entry"""
i=self.listbox.GetSelection()
if i==-1:
if self.lastcurrententry>=0:
i=self.lastcurrententry
else:
return None
self.lastcurrententry=i
return self.getentry(i)
Post by d***@netzero.com
-Joe Pham
d***@netzero.com
2005-01-30 05:10:00 UTC
Permalink
Stephen, I just committed an update to calendarentryeditor, please give it a try and let me know how it works for you.

-Joe Pham



______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!
Stephen Wood
2005-01-30 19:29:58 UTC
Permalink
It works fine now. I can create, edit and delete entries without exceptions.

Stephen
Post by d***@netzero.com
Stephen, I just committed an update to calendarentryeditor, please give it a try and let me know how it works for you.
-Joe Pham
Loading...