Index: trunk/tools/editor_trends/analyses/plugins/taxonomy_list_makers.py |
— | — | @@ -31,11 +31,12 @@ |
32 | 32 | titles that begin with "List of..." |
33 | 33 | """ |
34 | 34 | data = kwargs.get('data', None) |
35 | | - treshold = kwargs.get('treshold', 10) |
| 35 | + cutoff = kwargs.get('cutoff', 10) |
36 | 36 | today = datetime.today() |
37 | 37 | |
38 | 38 | if data == None: |
39 | | - print 'Ooooopppsssss.....' |
| 39 | + print '''For this plugin to function, it needs to preload data from the |
| 40 | + articles collection.''' |
40 | 41 | sys.exit(-1) |
41 | 42 | |
42 | 43 | articles_edited = editor['articles_edited'] |
— | — | @@ -45,21 +46,21 @@ |
46 | 47 | for year in years: |
47 | 48 | months = articles_edited[year].keys() |
48 | 49 | 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 |
58 | 59 | |
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 """ |
60 | 61 | |
61 | | - if count > treshold: |
| 62 | + if count > cutoff: |
62 | 63 | var.add(today, count, {'username': editor['username']}) |
63 | | - print editor['username'], count |
| 64 | + #print editor['username'], count |
64 | 65 | return var |
65 | 66 | |
66 | 67 | |