tricycle/lesswrong — pull request #54 by johnsoft (2012-10-30 01:14:33+00:00)
Title: Karma percent

This patch adds percentage hovers to link/comment scores and the sidebar scores, as per [issue 319][319]. Here's what it currently looks like:

![Screenshot][scr]

It comes with a migration script at ` scripts/recalc_karma.py`, which should be run before the code is deployed. I didn't think it was worth wrestling with paster to figure out how to handle command-line arguments (sorry), but script options can be set on this line:

KarmaCalc(dry_run=False, migrate=True).run()

As long as migrate is set to True, the script is safe to run and re-run, in the sense that the old and new karma systems use a non-overlapping set of database keys. After scanning the database, the script reports values which differ from their calculated value. It would probably be a good idea to make sure no scores are wildly inconsistent before rolling this out.

[319]: http://code.google.com/p/lesswrong/issues/detail?id=319
[scr]: http://i.imgur.com/gCOLq.png