Merge lp:~ken-vandine/friends/persist_changes into lp:friends

Proposed by Ken VanDine
Status: Merged
Approved by: Ken VanDine
Approved revision: 180
Merged at revision: 179
Proposed branch: lp:~ken-vandine/friends/persist_changes
Merge into: lp:friends
Diff against target: 35 lines (+4/-0)
2 files modified
friends/utils/base.py (+3/-0)
tools/debug_slave.py (+1/-0)
To merge this branch: bzr merge lp:~ken-vandine/friends/persist_changes
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Robert Bruce Park Approve
Review via email: mp+157243@code.launchpad.net

Commit message

Call persist_model after modifying to ensure changes are synchronized.

Description of the change

Call persist_model after modifying to ensure changes are synchronized. Also connect debug_slave.py to row-changed to help debug changes to rows.

To post a comment you must log in.
Revision history for this message
Robert Bruce Park (robru) wrote :

Tests pass, and I checked debug_slave.py too, it does appear to update immediately there.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:180
http://jenkins.qa.ubuntu.com/job/friends-ci/18/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/friends-raring-amd64-ci/18

Click here to trigger a rebuild:
http://s-jenkins:8080/job/friends-ci/18/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'friends/utils/base.py'
2--- friends/utils/base.py 2013-04-02 21:30:43 +0000
3+++ friends/utils/base.py 2013-04-04 22:35:29 +0000
4@@ -520,16 +520,19 @@
5 """Set a column value associated with a specific message_id."""
6 row_id, col_idx = self._calculate_row_cell(message_id, column_name)
7 Model.get_row(row_id)[col_idx] = value
8+ persist_model()
9
10 def _inc_cell(self, message_id, column_name):
11 """Increment a column value associated with a specific message_id."""
12 row_id, col_idx = self._calculate_row_cell(message_id, column_name)
13 Model.get_row(row_id)[col_idx] += 1
14+ persist_model()
15
16 def _dec_cell(self, message_id, column_name):
17 """Decrement a column value associated with a specific message_id."""
18 row_id, col_idx = self._calculate_row_cell(message_id, column_name)
19 Model.get_row(row_id)[col_idx] -= 1
20+ persist_model()
21
22 def _new_book_client(self, source):
23 client = EBook.BookClient.new(source)
24
25=== modified file 'tools/debug_slave.py'
26--- tools/debug_slave.py 2013-02-26 18:36:09 +0000
27+++ tools/debug_slave.py 2013-04-04 22:35:29 +0000
28@@ -19,6 +19,7 @@
29 print('Joining model ' + model_name)
30 self.model = Dee.SharedModel.new(model_name)
31 self.model.connect('row-added', self.on_row_added)
32+ self.model.connect('row-changed', self.on_row_added)
33
34 def on_row_added(self, model, itr):
35 row = self.model.get_row(itr)

Subscribers

People subscribed via source and target branches

to all changes: