r85419 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85418‎ | r85419 | r85420 >
Date:04:16, 5 April 2011
Author:diederik
Status:deferred
Tags:
Comment:
Updated plugin so it works with the new datasets.
Modified paths:
  • /trunk/tools/editor_trends/analyses/plugins/taxonomy_burnout.py (modified) (history)

Diff [purge]

Index: trunk/tools/editor_trends/analyses/plugins/taxonomy_burnout.py
@@ -24,6 +24,7 @@
2525 edits = editor['edit_count']
2626 final_edit = editor['final_edit']
2727 cutoff = kwargs.get('cutoff', 149)
 28+ username = editor['username']
2829
2930 burnout = False
3031 sum = 0.0
@@ -46,14 +47,14 @@
4748 count += 1.0
4849 except (AttributeError, KeyError):
4950 print 'Editor %s does not have data for year: %s and month %s. Data: %s' \
50 - % (editor['username'], year, month, edits[year])
 51+ % (username, year, month, edits[year])
5152
5253 if burnout and sum / count > 10:
5354 avg_edit = sum / count
5455
5556 try:
56 - var.add(new_wikipedian, avg_edit, {'username' : editor['username']})
 57+ var.add(new_wikipedian, avg_edit, {'username' : username})
5758 except Exception, error:
58 - print 'user: %s error: %s' % (editor['username'].encode('utf-8'), error)
 59+ print 'user: %s error: %s' % (username, error)
5960
6061 return var