Index: trunk/tools/editor_trends/analyses/plugins/taxonomy_burnout.py |
— | — | @@ -24,6 +24,7 @@ |
25 | 25 | edits = editor['edit_count'] |
26 | 26 | final_edit = editor['final_edit'] |
27 | 27 | cutoff = kwargs.get('cutoff', 149) |
| 28 | + username = editor['username'] |
28 | 29 | |
29 | 30 | burnout = False |
30 | 31 | sum = 0.0 |
— | — | @@ -46,14 +47,14 @@ |
47 | 48 | count += 1.0 |
48 | 49 | except (AttributeError, KeyError): |
49 | 50 | 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]) |
51 | 52 | |
52 | 53 | if burnout and sum / count > 10: |
53 | 54 | avg_edit = sum / count |
54 | 55 | |
55 | 56 | try: |
56 | | - var.add(new_wikipedian, avg_edit, {'username' : editor['username']}) |
| 57 | + var.add(new_wikipedian, avg_edit, {'username' : username}) |
57 | 58 | except Exception, error: |
58 | | - print 'user: %s error: %s' % (editor['username'].encode('utf-8'), error) |
| 59 | + print 'user: %s error: %s' % (username, error) |
59 | 60 | |
60 | 61 | return var |