http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10988
Revision: 10988 Author: xqt Date: 2013-01-27 11:10:19 +0000 (Sun, 27 Jan 2013) Log Message: ----------- A new parent class for all wikimedia families
Modified Paths: -------------- trunk/pywikipedia/family.py
Modified: trunk/pywikipedia/family.py =================================================================== --- trunk/pywikipedia/family.py 2013-01-27 10:47:27 UTC (rev 10987) +++ trunk/pywikipedia/family.py 2013-01-27 11:10:19 UTC (rev 10988) @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*-
# -# (C) Pywikipedia bot team, 2004-2012 +# (C) Pywikipedia bot team, 2004-2013 # # Distributed under the terms of the MIT license. # @@ -14,9 +14,9 @@ import config import wikipedia as pywikibot
+ # Parent class for all wiki families - -class Family: +class Family(object): def __init__(self): self.name = None # For interwiki sorting order see @@ -3234,7 +3234,7 @@ #}, }
- self.namespacesWithSubpage = [2] + range(1, 16, 2) + self.namespacesWithSubpage = [2] + range(1, 16, 2)
# letters that can follow a wikilink and are regarded as part of # this link @@ -4374,3 +4374,11 @@ """Does a conversion on the text to insert on the wiki i.e. Esperanto X-conversion """ return putText + + +# Parent class for all wikimedia families +class WikimediaFamily(Family): + def __init__(self): + super(WikimediaFamily, self).__init__() + + self.namespacesWithSubpage.extend([4, 12])
pywikipedia-svn@lists.wikimedia.org