1 --- a/mwlib/mwapidb.py Tue Nov 18 10:51:41 2008 +0100
2 +++ b/mwlib/mwapidb.py Tue Nov 18 14:23:02 2008 +0100
3 @@ -641,12 +641,12 @@
4 revision,
5 )
6
7 - def getAuthors(self, title, revision=None, max_num_authors=10):
8 - """Return at most max_num_authors names of non-bot, non-anon users for
9 + def getAuthors(self, title, revision=None):
10 + """Return names of non-bot, non-anon users for
11 non-minor changes of given article (before given revsion).
12
13 - @returns: list of principal authors
14 - @rtype: [unicode]
15 + @returns: set of principal authors
16 + @rtype: set([unicode])
17 """
18
19 for rvlimit in (500, 50):
20 @@ -671,22 +671,13 @@
21 except KeyError:
22 return None
23
24 - authors = [r['user'] for r in revs
25 + return list(set([r['user'] for r in revs
26 if not r.get('anon')
27 and not self.ip_rex.match(r['user'])
28 and not r.get('minor')
29 and not self.bot_rex.search(r.get('comment', ''))
30 and not self.bot_rex.search(r['user'])
31 - ]
32 - author2count = {}
33 - for a in authors:
34 - try:
35 - author2count[a] += 1
36 - except KeyError:
37 - author2count[a] = 1
38 - author2count = author2count.items()
39 - author2count.sort(key=lambda a: -a[1])
40 - return [a[0] for a in author2count[:max_num_authors]]
41 + ]))
42
43 def getTemplate(self, name, followRedirects=True):
44 """
1.1 --- a/mwlib/treecleaner.py Tue Nov 18 10:51:41 2008 +0100
1.2 +++ b/mwlib/treecleaner.py Tue Nov 18 14:23:02 2008 +0100
1.3 @@ -317,6 +317,7 @@
1.4 if colspan and colspan > maxwidth:
1.5 self.report('fixed colspan from', cell.vlist.get('colspan', 'undefined'), 'to', maxwidth)
1.6 cell.vlist['colspan'] = maxwidth
1.7 +
1.8
1.9 # /SINGLE CELL COLSPAN
1.10 for c in node.children:
1.11 @@ -353,7 +354,7 @@
1.12 for child in cell_content:
1.13 d.appendChild(child)
1.14 d.vlist = node.vlist
1.15 - #node.parent.replaceChild(node, cell_content)
1.16 + #node.parent.replaceChild(node, cell_content)
1.17
1.18 for c in node.children:
1.19 self.removeSingleCellTables(c)
1.20 @@ -371,7 +372,9 @@
1.21 for item in cell:
1.22 d.appendChild(item)
1.23 divs.append(d)
1.24 - node.parent.replaceChild(node, divs)
1.25 + parent = node.parent
1.26 + parent.replaceChild(node, divs)
1.27 + self.report('replaced single col table with div. div children:', parent.children)
1.28 return
1.29
1.30 for c in node:
1.31 @@ -392,7 +395,8 @@
1.32 return
1.33
1.34 for c in node.children:
1.35 - self.moveReferenceListSection(c)
1.36 + self.moveReferenceListSection(c)
1.37 +
1.38
1.39 # FIXME: replace this by implementing and using
1.40 # getParentStyleInfo(style='blub') where parent styles are needed