GTG

DBus interface to GTG

Bug #329989 reported by Lionel Dricot
40
This bug affects 6 people
Affects Status Importance Assigned to Milestone
GTG
Fix Released
High
Ryan Paul

Bug Description

You should be able to control GTG via DBUS.

Changed in gtg:
assignee: nobody → ploum
importance: Undecided → High
status: New → Confirmed
Changed in gtg:
milestone: none → 0.2
Revision history for this message
Pititjo (jonathan-barnoud) wrote :

What are the plans about gtg dbus support ?

Here is actions that I think an application must be able to do with it :
- open a task in a task editor
- show/hide the task browser and specify the view
- get task list for a specific view (all, work view, tags)
- get tag list
- for a task :
    - get task content
    - get task title
    - get task tags
    - get task subtask
    - edit task
    - edit title
    - add tag
    - delete task
    - change dates
- create task with a specific parent or not

Revision history for this message
Alexey Nedilko (alexey.nedilko) wrote :

This is very much desired, because this would allow to integrate GTG with other great apps, like GNOME Do.

Revision history for this message
Chris Halse Rogers (raof) wrote :

Is this being actively worked on? Should potential contributors not attempt to provide patches for this?

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

Chris > has work has been a bit stalled on this lately, maybe an helping would be great. But if you plan to do it, better to discuss with us on how you intend to do it.

Revision history for this message
Ryan Paul (segphault) wrote :

I have implemented a D-Bus interface in revision 259 of my branch:
http://bazaar.launchpad.net/~segphault/gtg/couchdb-backend/revision/259

It supports the following methods:

get_task_ids()
get_task(tid)
get_tasks()
get_task_ids_filtered(tags, status, started_only, is_root)
get_tasks_filtered(tags, status, started_only, is_root)
has_task(tid)
delete_task(tid)
new_task(status, title, duedate, startdate, donedate, tags, text, subtasks)
modify_task(tid, task_data)
open_task_editor(tid)
hide_task_browser()
show_task_browser()

I have published some sample code that demonstrates how to use it here:
http://gist.github.com/143430

The tasks are returned as python dictionaries with the following values:

{"id": task.get_id(),
 "status": task.get_status(),
 "title": task.get_title(),
 "duedate": task.get_due_date(),
 "startdate": task.get_start_date(),
 "donedate": task.get_closed_date(),
 "tags": task.get_tags_name(),
 "text": task.get_text(),
 "subtask": task.get_subtasks_tid()}

The modify a task, you can change those values in the dictionary and then pass the modified dictionary as the task_data parameter in the modify_task method.

For reasons that I don't entirely understand, filtering on tags does not work. Everything else should work as expected. I'm hoping that somebody who is more familiar with the program's internals will be able to fix the tag filtering part.

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

wow, nice. I will test that and try to save the tag filtering part as soon as possible.

Changed in gtg:
assignee: Lionel Dricot (ploum) → Ryan Paul (segphault)
status: Confirmed → In Progress
Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

Thanks Ryan for this great contribution.

There are still a few points I want to improve (you talked about a bug with the tag filtering, our coding practices are more verbose than yours, specially for return values, one function I'm still not sure I fully understand). Nevertheless, I think that all those issues can be solved in the trunk so I merged your branch. Feel free to improve it and resend patches at any time ! To all edge users : please test and report bugs !

Also, we should document that on our wiki.

Thanks a lot :-)

Changed in gtg:
status: In Progress → Fix Committed
Changed in gtg:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers