r85933 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85932‎ | r85933 | r85934 >
Date:23:51, 12 April 2011
Author:diederik
Status:deferred
Tags:
Comment:
Some more documentation
Modified paths:
  • /trunk/tools/editor_trends/analyses/plugins/taxonomy_list_makers.py (modified) (history)

Diff [purge]

Index: trunk/tools/editor_trends/analyses/plugins/taxonomy_list_makers.py
@@ -31,11 +31,12 @@
3232 titles that begin with "List of..."
3333 """
3434 data = kwargs.get('data', None)
35 - treshold = kwargs.get('treshold', 10)
 35+ cutoff = kwargs.get('cutoff', 10)
3636 today = datetime.today()
3737
3838 if data == None:
39 - print 'Ooooopppsssss.....'
 39+ print '''For this plugin to function, it needs to preload data from the
 40+ articles collection.'''
4041 sys.exit(-1)
4142
4243 articles_edited = editor['articles_edited']
@@ -45,21 +46,21 @@
4647 for year in years:
4748 months = articles_edited[year].keys()
4849 for month in months:
49 - namespaces = articles_edited[year][month].keys()
50 - for ns in namespaces:
51 - articles = articles_edited[year][month].get(ns, [])
52 - for article in articles:
53 - #print article, data.get(article, None)
54 - try:
55 - count += data[article]
56 - except KeyError:
57 - pass
 50+ #namespaces = articles_edited[year][month].keys()
 51+ #for ns in namespaces:
 52+ articles = articles_edited[year][month].get(0, [])
 53+ for article in articles:
 54+ #print article, data.get(article, None)
 55+ try:
 56+ count += data[article]
 57+ except KeyError:
 58+ pass
5859
59 - """ Add all editors with an edit count of more than 10 """
 60+ """Add all editors with an edit count of more than the treshold, default 10 """
6061
61 - if count > treshold:
 62+ if count > cutoff:
6263 var.add(today, count, {'username': editor['username']})
63 - print editor['username'], count
 64+ #print editor['username'], count
6465 return var
6566
6667