Merge lp://qastaging/~kai-mast/friends/keep-mentions into lp://qastaging/friends

Proposed by Kai Mast
Status: Needs review
Proposed branch: lp://qastaging/~kai-mast/friends/keep-mentions
Merge into: lp://qastaging/friends
Diff against target: 102 lines (+32/-16)
3 files modified
friends/main.py (+3/-1)
friends/tests/test_model.py (+2/-11)
friends/utils/model.py (+27/-4)
To merge this branch: bzr merge lp://qastaging/~kai-mast/friends/keep-mentions
Reviewer Review Type Date Requested Status
Super Friends Pending
Review via email: mp+204784@code.qastaging.launchpad.net

Commit message

Purge old messages on a per-stream basis.

Description of the change

Tested this the last days and it works fine for me.

Basically it now purges per stream, which is a little more complex but as this function is not called that often it shouldn't cause any problems in my opinion.

To post a comment you must log in.
Revision history for this message
Kai Mast (kai-mast) wrote :

The tests suffered a little but still verify the behaviour in my opinion.

255. By Kai Mast

Removed test-changelog

Revision history for this message
Kai Mast (kai-mast) wrote :

Could somebody review this please?

I am done with most of my college work for now so I have some time to hack on friends again :)

Revision history for this message
Robert Bruce Park (robru) wrote :

Hi Kai, I have a couple concerns about this branch:

* I'd like to see the 'counts' dict be a defaultdict. Then you save having to check whether the stream is already present or not.

* I see a lot of deletions from the testsuite and no additions. Any way you can flesh out the tests to cover the new behavior?

Revision history for this message
Robert Bruce Park (robru) wrote :

Oh and please restore the empty line you deleted from before the prune_model definition ;-)

Revision history for this message
Robert Bruce Park (robru) wrote :

I mean persist_model, oops.

Revision history for this message
Robert Bruce Park (robru) wrote :

Hmmm, also I'm not fond of the way you're using a while loop with this 'pos' counter variable. I'm pretty sure you can do 'for row in Model' instead, and you might even be able to do 'for row in reversed(Model)' if you want to iterate newest first (I think).

256. By Kai Mast

use defaultdict for dispatcher

257. By Kai Mast

restore deleted line

258. By Kai Mast

First steps into restoring tests

Revision history for this message
Kai Mast (kai-mast) wrote :

Hi,

sorry totally forgot about this merge request. Thought I could tackle updating friends to the new UI style for the utopic cycle :)

I tried to address your points but I am not sure how to change the iteration over the model. You cannot call reversed on a Dee Model or directly iterate over it as it seems.

Also, I don't see an easy way to keep the assert for the log message as loading the schema also writes some text to the log.

Still, I think this works really nice and should be merged :)

Unmerged revisions

258. By Kai Mast

First steps into restoring tests

257. By Kai Mast

restore deleted line

256. By Kai Mast

use defaultdict for dispatcher

255. By Kai Mast

Removed test-changelog

254. By Kai Mast

Merge with trunk

253. By Kai Mast

Added changelog to build deb

252. By Kai Mast

'Fixed' tests

251. By Kai Mast

Seems to do what I want it to do

250. By Kai Mast

First 'mockup'

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: