This post originated from an RSS feed registered with Web Buzz
by Stuart Langridge.
Original Post: Adding tasks to Evolution from Python
Feed Title: as days pass by
Feed URL: http://feeds.feedburner.com/kryogenix
Feed Description: scratched tallies on the prison wall
What I can't seem to do, though, is create a new task list. I ought to be able to. Lists created in Evolution itself seem to have a list uri that looks like local:(time).(number)@(machinename). So I think this should work:
>>> new_list_source = evolution.ecal.open_calendar_source_new_with_absolute_uri('Created from Python',
'local:%s00.2.giles' % time.time(),
evolution.ecal.CAL_SOURCE_TYPE_TODO)
>>> new_task_2 = evolution.ecal.ECalComponent(evolution.ecal.CAL_COMPONENT_TODO)
>>> new_task_2.set_summary('New task in a new list')
>>> new_list_source.add_object(new_task_2)
...but it does not. No errors are thrown, and the newly created source doesn't seem to be invalid (that is: I can add a newly created task to it, and that doesn't throw an error either), but... the newly created list (or task) doesn't show up in Evolution. No idea what I'm doing wrong here; I would guess that I need to somehow "save" the new task list, but I can't see how? Any suggestions?