r84983 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84982‎ | r84983 | r84984 >
Date:21:45, 29 March 2011
Author:rfaulk
Status:deferred
Tags:
Comment:
Modifying plug-in names to conform to new naming convention for Taxonomy Project.
Modified paths:
  • /trunk/tools/editor_trends/analyses/plugins/burnout.py (deleted) (history)
  • /trunk/tools/editor_trends/analyses/plugins/list_makers.py (deleted) (history)
  • /trunk/tools/editor_trends/analyses/plugins/taxonomy_burnout.py (added) (history)
  • /trunk/tools/editor_trends/analyses/plugins/taxonomy_list_makers.py (added) (history)

Diff [purge]

Index: trunk/tools/editor_trends/analyses/plugins/list_makers.py
@@ -1,42 +0,0 @@
2 -#!/usr/bin/python
3 -# -*- coding: utf-8 -*-
4 -'''
5 -Copyright (C) 2011 by Ryan Faulkner (rfaulkner@wikimedia.org)
6 -This program is free software; you can redistribute it and/or
7 -modify it under the terms of the GNU General Public License version 2
8 -as published by the Free Software Foundation.
9 -This program is distributed in the hope that it will be useful,
10 -but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 -See the GNU General Public License for more details, at
13 -http://www.fsf.org/licenses/gpl.html
14 -'''
15 -
16 -__author__ = '''\n'''.join(['Diederik van Liere (dvanliere@gmail.com)', ])
17 -__email__ = 'dvanliere at gmail dot com'
18 -__date__ = '2011-01-25'
19 -__version__ = '0.1'
20 -
21 -def list_makers(var, editor, **kwargs):
22 - """
23 - == List makers ==
24 - Any editor who makes more than 10 mainspace edits a month to articles with titles that begin with "List of..."
25 - """
26 - articles_by_year = editor['articles_by_year']
27 - count = 0
28 -
29 - for year in xrange(new_wikipedian.year, var.max_year):
30 - for month in xrange(1, 13):
31 - for article in articles_by_year[year][month]:
32 - """ locate article titles containing "List of" """
33 - if article.find('List of') > -1:
34 - count = count + 1
35 -
36 -
37 - """ Add all editors with an edit count of more than 10 """
38 -
39 - if count > 10:
40 - var.add(editor['username'], 1)
41 -
42 -
43 - return var
Index: trunk/tools/editor_trends/analyses/plugins/burnout.py
@@ -1,41 +0,0 @@
2 -#!/usr/bin/python
3 -# -*- coding: utf-8 -*-
4 -'''
5 -Copyright (C) 2011 by Ryan Faulkner (rfaulkner@wikimedia.org)
6 -This program is free software; you can redistribute it and/or
7 -modify it under the terms of the GNU General Public License version 2
8 -as published by the Free Software Foundation.
9 -This program is distributed in the hope that it will be useful,
10 -but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 -See the GNU General Public License for more details, at
13 -http://www.fsf.org/licenses/gpl.html
14 -'''
15 -
16 -__author__ = '''\n'''.join(['Diederik van Liere (dvanliere@gmail.com)', ])
17 -__email__ = 'dvanliere at gmail dot com'
18 -__date__ = '2011-01-25'
19 -__version__ = '0.1'
20 -
21 -
22 -
23 -def burnout(var, editor, **kwargs):
24 - new_wikipedian = editor['new_wikipedian']
25 - edits = editor['monthly_edits']
26 -
27 - burnout = False
28 - sum =0.0
29 - count = 0.0
30 -
31 - for year in xrange(new_wikipedian.year, var.max_year):
32 - for month in xrange(1, 13):
33 - if edits[year][month] > 249:
34 - burnout = True
35 - if burnout == True:
36 - sum += edits[year][month]
37 - count +=1.0
38 -
39 - if sum / count < 10 and burnout == True:
40 - var.add(editor['username'], 1)
41 -
42 - return var
Index: trunk/tools/editor_trends/analyses/plugins/taxonomy_list_makers.py
@@ -0,0 +1,42 @@
 2+#!/usr/bin/python
 3+# -*- coding: utf-8 -*-
 4+'''
 5+Copyright (C) 2011 by Ryan Faulkner (rfaulkner@wikimedia.org)
 6+This program is free software; you can redistribute it and/or
 7+modify it under the terms of the GNU General Public License version 2
 8+as published by the Free Software Foundation.
 9+This program is distributed in the hope that it will be useful,
 10+but WITHOUT ANY WARRANTY; without even the implied warranty of
 11+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 12+See the GNU General Public License for more details, at
 13+http://www.fsf.org/licenses/gpl.html
 14+'''
 15+
 16+__author__ = '''\n'''.join(['Diederik van Liere (dvanliere@gmail.com)', ])
 17+__email__ = 'dvanliere at gmail dot com'
 18+__date__ = '2011-01-25'
 19+__version__ = '0.1'
 20+
 21+def list_makers(var, editor, **kwargs):
 22+ """
 23+ == List makers ==
 24+ Any editor who makes more than 10 mainspace edits a month to articles with titles that begin with "List of..."
 25+ """
 26+ articles_by_year = editor['articles_by_year']
 27+ count = 0
 28+
 29+ for year in xrange(new_wikipedian.year, var.max_year):
 30+ for month in xrange(1, 13):
 31+ for article in articles_by_year[year][month]:
 32+ """ locate article titles containing "List of" """
 33+ if article.find('List of') > -1:
 34+ count = count + 1
 35+
 36+
 37+ """ Add all editors with an edit count of more than 10 """
 38+
 39+ if count > 10:
 40+ var.add(editor['username'], 1)
 41+
 42+
 43+ return var
Index: trunk/tools/editor_trends/analyses/plugins/taxonomy_burnout.py
@@ -0,0 +1,41 @@
 2+#!/usr/bin/python
 3+# -*- coding: utf-8 -*-
 4+'''
 5+Copyright (C) 2011 by Ryan Faulkner (rfaulkner@wikimedia.org)
 6+This program is free software; you can redistribute it and/or
 7+modify it under the terms of the GNU General Public License version 2
 8+as published by the Free Software Foundation.
 9+This program is distributed in the hope that it will be useful,
 10+but WITHOUT ANY WARRANTY; without even the implied warranty of
 11+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 12+See the GNU General Public License for more details, at
 13+http://www.fsf.org/licenses/gpl.html
 14+'''
 15+
 16+__author__ = '''\n'''.join(['Diederik van Liere (dvanliere@gmail.com)', ])
 17+__email__ = 'dvanliere at gmail dot com'
 18+__date__ = '2011-01-25'
 19+__version__ = '0.1'
 20+
 21+
 22+
 23+def burnout(var, editor, **kwargs):
 24+ new_wikipedian = editor['new_wikipedian']
 25+ edits = editor['monthly_edits']
 26+
 27+ burnout = False
 28+ sum =0.0
 29+ count = 0.0
 30+
 31+ for year in xrange(new_wikipedian.year, var.max_year):
 32+ for month in xrange(1, 13):
 33+ if edits[year][month] > 249:
 34+ burnout = True
 35+ if burnout == True:
 36+ sum += edits[year][month]
 37+ count +=1.0
 38+
 39+ if sum / count < 10 and burnout == True:
 40+ var.add(editor['username'], 1)
 41+
 42+ return var