Merge lp:~sil/desktopcouch/glib-callback-for-changes into lp:desktopcouch
Status: | Work in progress | ||||
---|---|---|---|---|---|
Proposed branch: | lp:~sil/desktopcouch/glib-callback-for-changes | ||||
Merge into: | lp:desktopcouch | ||||
Diff against target: |
166 lines (+136/-1) 2 files modified
desktopcouch/records/server.py (+97/-1) desktopcouch/records/tests/test_server.py (+39/-0) |
||||
To merge this branch: | bzr merge lp:~sil/desktopcouch/glib-callback-for-changes | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
dobey (community) | Needs Fixing | ||
Vincenzo Di Somma (community) | Needs Fixing | ||
Eric Casteleijn (community) | Approve | ||
Review via email: mp+40415@code.launchpad.net |
Commit message
An implementation of glib_callback_
Description of the change
An implementation of glib_callback_
Use in a glib program:
def my_callback(data):
print "a record with id %s was changed" % data["id"]
db = CouchDatabase(
db.glib_
gtk.main()
Unmerged revisions
- 203. By Stuart Langridge
-
correct enable message
- 202. By Stuart Langridge
-
merge from trunk
- 201. By Stuart Langridge
-
bow and scrape before the almighty god pylint
- 200. By Stuart Langridge
-
An implementation of glib_callback_
for_changes which allows a glib program to attach a callback which is called whenever a change happens in a desktopcouch database
I like this functionality, but would like it better if it weren't a member of CouchDatabase (which I would like to remain agnostic of anything platform specific.) My intuition is that it doesn't need to be, since it makes relatively little use of self. I would probably strive for a function called something like 'add_glib_callback' that takes a database object and a callback function.
In addition I'd like a more generic callback function which knows nothing about glib, which could then be used by the glib one.
I know little of glib, so I don't know how realistic these preferences are.