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
=== modified file 'friends/utils/base.py'
--- friends/utils/base.py 2013-04-02 21:30:43 +0000
+++ friends/utils/base.py 2013-04-04 22:35:29 +0000
@@ -520,16 +520,19 @@
520 """Set a column value associated with a specific message_id."""520 """Set a column value associated with a specific message_id."""
521 row_id, col_idx = self._calculate_row_cell(message_id, column_name)521 row_id, col_idx = self._calculate_row_cell(message_id, column_name)
522 Model.get_row(row_id)[col_idx] = value522 Model.get_row(row_id)[col_idx] = value
523 persist_model()
523524
524 def _inc_cell(self, message_id, column_name):525 def _inc_cell(self, message_id, column_name):
525 """Increment a column value associated with a specific message_id."""526 """Increment a column value associated with a specific message_id."""
526 row_id, col_idx = self._calculate_row_cell(message_id, column_name)527 row_id, col_idx = self._calculate_row_cell(message_id, column_name)
527 Model.get_row(row_id)[col_idx] += 1528 Model.get_row(row_id)[col_idx] += 1
529 persist_model()
528530
529 def _dec_cell(self, message_id, column_name):531 def _dec_cell(self, message_id, column_name):
530 """Decrement a column value associated with a specific message_id."""532 """Decrement a column value associated with a specific message_id."""
531 row_id, col_idx = self._calculate_row_cell(message_id, column_name)533 row_id, col_idx = self._calculate_row_cell(message_id, column_name)
532 Model.get_row(row_id)[col_idx] -= 1534 Model.get_row(row_id)[col_idx] -= 1
535 persist_model()
533536
534 def _new_book_client(self, source):537 def _new_book_client(self, source):
535 client = EBook.BookClient.new(source)538 client = EBook.BookClient.new(source)
536539
=== modified file 'tools/debug_slave.py'
--- tools/debug_slave.py 2013-02-26 18:36:09 +0000
+++ tools/debug_slave.py 2013-04-04 22:35:29 +0000
@@ -19,6 +19,7 @@
19 print('Joining model ' + model_name)19 print('Joining model ' + model_name)
20 self.model = Dee.SharedModel.new(model_name)20 self.model = Dee.SharedModel.new(model_name)
21 self.model.connect('row-added', self.on_row_added)21 self.model.connect('row-added', self.on_row_added)
22 self.model.connect('row-changed', self.on_row_added)
2223
23 def on_row_added(self, model, itr):24 def on_row_added(self, model, itr):
24 row = self.model.get_row(itr)25 row = self.model.get_row(itr)

Subscribers

People subscribed via source and target branches

to all changes: