Created
July 9, 2009 04:32
-
-
Save segphault/143430 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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