Skip to content

Instantly share code, notes, and snippets.

@segphault
Created July 9, 2009 04:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save segphault/143430 to your computer and use it in GitHub Desktop.
Save segphault/143430 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
"""
NOTE: This example is outdated and no longer works properly.
For the latest working example, please see the GTG wiki:
http://live.gnome.org/gtg/dbus
"""
import dbus
bus = dbus.SessionBus()
obj = bus.get_object("com.fritalk.GTG", "/com/fritalk/GTG")
gtg = dbus.Interface(obj, "com.fritalk.GTG")
for t in gtg.get_tasks(): print t
for t in gtg.get_tasks_filtered([], ["Active"], False, False):
print t["id"], t["title"], t["tags"]
for t in gtg.get_task_ids_filtered([], ["Active"], False, False):
print t
t1 = gtg.new_task(
"Active", # status
"This is another test", # title
"2009-07-10", # due date
"2009-07-07", # start date
"", # finish date
["@ars"], # tags
"This is more test content!", # text
[]) # subtask ids
t2 = gtg.new_task(
"Active", # status
"This is a test", # title
"2009-07-10", # due date
"2009-07-07", # start date
"", # finish date
["@ars", "@article"], # tags
"This is test content!", # text
[t1["id"]]) # subtask ids
for t in gtg.get_tasks():
if "test" in t["title"]:
gtg.delete_task(t["id"])
tid = "4@1"
if gtg.has_task(tid):
t = gtg.get_task("4@1")
t["title"] = "I've changed the title!"
t["tags"].append("@test")
gtg.modify_task(tid, t)
for t in gtg.get_tasks():
if "Qt" in t["title"]:
gtg.open_task_editor(t["id"])
gtg.hide_task_browser()
gtg.show_task_browser()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment