http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10993
Revision: 10993 Author: xqt Date: 2013-01-27 12:38:06 +0000 (Sun, 27 Jan 2013) Log Message: ----------- make mw families a subclass of family.WikimediaFamily, update from trunk r10991
Modified Paths: -------------- branches/rewrite/pywikibot/families/commons_family.py branches/rewrite/pywikibot/families/incubator_family.py branches/rewrite/pywikibot/families/mediawiki_family.py branches/rewrite/pywikibot/families/meta_family.py branches/rewrite/pywikibot/families/species_family.py branches/rewrite/pywikibot/families/strategy_family.py branches/rewrite/pywikibot/families/test_family.py branches/rewrite/pywikibot/families/wikibooks_family.py branches/rewrite/pywikibot/families/wikidata_family.py branches/rewrite/pywikibot/families/wikinews_family.py branches/rewrite/pywikibot/families/wikipedia_family.py branches/rewrite/pywikibot/families/wikiquote_family.py branches/rewrite/pywikibot/families/wikisource_family.py branches/rewrite/pywikibot/families/wikitech_family.py branches/rewrite/pywikibot/families/wikiversity_family.py branches/rewrite/pywikibot/families/wikivoyage_family.py branches/rewrite/pywikibot/families/wiktionary_family.py
Modified: branches/rewrite/pywikibot/families/commons_family.py =================================================================== --- branches/rewrite/pywikibot/families/commons_family.py 2013-01-27 12:17:32 UTC (rev 10992) +++ branches/rewrite/pywikibot/families/commons_family.py 2013-01-27 12:38:06 UTC (rev 10993) @@ -6,9 +6,9 @@
# The Wikimedia Commons family
-class Family(family.Family): +class Family(family.WikimediaFamily): def __init__(self): - family.Family.__init__(self) + super(Family, self).__init__() self.name = 'commons' self.langs = { 'commons': 'commons.wikimedia.org', @@ -35,17 +35,10 @@ self.disambcatname = { 'commons': u'Disambiguation' } - self.cross_projects = [ - 'wikipedia', 'wiktionary', 'wikibooks', 'wikiquote', 'wikisource', 'wikinews', 'wikiversity', - 'meta', 'mediawiki', 'test', 'incubator', 'species', - ]
def dbName(self, code): return 'commonswiki_p'
- def shared_image_repository(self, code): - return ('commons', 'commons') - def ssl_pathprefix(self, code): return "/wikipedia/commons"
Modified: branches/rewrite/pywikibot/families/incubator_family.py =================================================================== --- branches/rewrite/pywikibot/families/incubator_family.py 2013-01-27 12:17:32 UTC (rev 10992) +++ branches/rewrite/pywikibot/families/incubator_family.py 2013-01-27 12:38:06 UTC (rev 10993) @@ -6,17 +6,13 @@
# The Wikimedia Incubator family
-class Family(family.Family): +class Family(family.WikimediaFamily): def __init__(self): - family.Family.__init__(self) + super(WikimediaFamily, self).__init__() self.name = 'incubator' self.langs = { 'incubator': 'incubator.wikimedia.org', }
- def shared_image_repository(self, code): - return ('commons', 'commons') - def ssl_pathprefix(self, code): - return "/wikipedia/incubator" - + return "/wikipedia/incubator" \ No newline at end of file
Modified: branches/rewrite/pywikibot/families/mediawiki_family.py =================================================================== --- branches/rewrite/pywikibot/families/mediawiki_family.py 2013-01-27 12:17:32 UTC (rev 10992) +++ branches/rewrite/pywikibot/families/mediawiki_family.py 2013-01-27 12:38:06 UTC (rev 10993) @@ -7,22 +7,14 @@ # The MediaWiki family # user-config.py: usernames['mediawiki']['mediawiki'] = 'User name'
-class Family(family.Family): +class Family(family.WikimediaFamily): def __init__(self): - family.Family.__init__(self) + super(Family, self).__init__() self.name = 'mediawiki'
self.langs = { 'mediawiki': 'www.mediawiki.org', } - self.cross_projects = [ - 'wikipedia', 'wiktionary', 'wikibooks', 'wikiquote', 'wikisource', - 'wikinews', 'wikiversity', 'meta', 'test', 'incubator', 'commons', - 'species', - ]
- def shared_image_repository(self, code): - return ('commons', 'commons') - def ssl_pathprefix(self, code): return "/wikipedia/mediawiki"
Modified: branches/rewrite/pywikibot/families/meta_family.py =================================================================== --- branches/rewrite/pywikibot/families/meta_family.py 2013-01-27 12:17:32 UTC (rev 10992) +++ branches/rewrite/pywikibot/families/meta_family.py 2013-01-27 12:38:06 UTC (rev 10993) @@ -6,23 +6,15 @@
# The meta wikimedia family
-class Family(family.Family): +class Family(family.WikimediaFamily): def __init__(self): - family.Family.__init__(self) + super(WikimediaFamily, self).__init__() self.name = 'meta' self.langs = { 'meta': 'meta.wikimedia.org', } self.interwiki_forward = 'wikipedia' self.cross_allowed = ['meta',] - self.cross_projects = [ - 'wikipedia', 'wiktionary', 'wikibooks', 'wikiquote', 'wikisource', - 'wikinews', 'wikiversity', 'mediawiki', 'test', 'incubator', - 'commons', 'species', - ]
- def shared_image_repository(self, code): - return ('commons', 'commons') - def ssl_pathprefix(self, code): return "/wikipedia/meta"
Modified: branches/rewrite/pywikibot/families/species_family.py =================================================================== --- branches/rewrite/pywikibot/families/species_family.py 2013-01-27 12:17:32 UTC (rev 10992) +++ branches/rewrite/pywikibot/families/species_family.py 2013-01-27 12:38:06 UTC (rev 10993) @@ -6,22 +6,14 @@
# The wikispecies family
-class Family(family.Family): +class Family(family.WikimediaFamily): def __init__(self): - family.Family.__init__(self) + super(Family, self).__init__() self.name = 'species' self.langs = { 'species': 'species.wikimedia.org', } self.interwiki_forward = 'wikipedia' - self.cross_projects = [ - 'wikipedia', 'wiktionary', 'wikibooks', 'wikiquote', 'wikisource', - 'wikinews', 'wikiversity', 'meta', 'mediawiki', 'test', 'incubator', - 'commons', - ]
- def shared_image_repository(self, code): - return ('commons', 'commons') - def ssl_pathprefix(self, code): return "/wikipedia/species"
Modified: branches/rewrite/pywikibot/families/strategy_family.py =================================================================== --- branches/rewrite/pywikibot/families/strategy_family.py 2013-01-27 12:17:32 UTC (rev 10992) +++ branches/rewrite/pywikibot/families/strategy_family.py 2013-01-27 12:38:06 UTC (rev 10993) @@ -6,9 +6,9 @@
# The Wikimedia Strategy family
-class Family(family.Family): +class Family(family.WikimediaFamily): def __init__(self): - family.Family.__init__(self) + super(Family, self).__init__() self.name = 'strategy' self.langs = { 'strategy': 'strategy.wikimedia.org', @@ -18,8 +18,5 @@ def dbName(self, code): return 'strategywiki_p'
- def shared_image_repository(self, code): - return ('commons', 'commons') - def ssl_pathprefix(self, code): return "/wikipedia/strategy"
Modified: branches/rewrite/pywikibot/families/test_family.py =================================================================== --- branches/rewrite/pywikibot/families/test_family.py 2013-01-27 12:17:32 UTC (rev 10992) +++ branches/rewrite/pywikibot/families/test_family.py 2013-01-27 12:38:06 UTC (rev 10993) @@ -5,16 +5,13 @@ from pywikibot import family
# The test wikipedia family -class Family(family.Family): +class Family(family.WikimediaFamily): def __init__(self): - family.Family.__init__(self) + super(Family, self).__init__() self.name = 'test' self.langs = { 'test': 'test.wikipedia.org', }
- def shared_image_repository(self, code): - return ('commons', 'commons') - def ssl_pathprefix(self, code): return "/wikipedia/test"
Modified: branches/rewrite/pywikibot/families/wikibooks_family.py =================================================================== --- branches/rewrite/pywikibot/families/wikibooks_family.py 2013-01-27 12:17:32 UTC (rev 10992) +++ branches/rewrite/pywikibot/families/wikibooks_family.py 2013-01-27 12:38:06 UTC (rev 10993) @@ -5,9 +5,9 @@
# The Wikimedia family that is known as Wikibooks
-class Family(family.Family): +class Family(family.WikimediaFamily): def __init__(self): - family.Family.__init__(self) + super(Family, self).__init__() self.name = 'wikibooks'
self.languages_by_size = [ @@ -103,6 +103,3 @@ 'zh-cn': 'zh', 'zu': None, # https://bugzilla.wikimedia.org/show_bug.cgi?id=25425 } - - def shared_image_repository(self, code): - return ('commons', 'commons')
Modified: branches/rewrite/pywikibot/families/wikidata_family.py =================================================================== --- branches/rewrite/pywikibot/families/wikidata_family.py 2013-01-27 12:17:32 UTC (rev 10992) +++ branches/rewrite/pywikibot/families/wikidata_family.py 2013-01-27 12:38:06 UTC (rev 10993) @@ -6,9 +6,9 @@
# The wikidata family
-class Family(family.Family): +class Family(family.WikimediaFamily): def __init__(self): - family.Family.__init__(self) + super(Family, self).__init__() self.name = 'wikidata' self.langs = { 'wikidata': 'wikidata.org',
Modified: branches/rewrite/pywikibot/families/wikinews_family.py =================================================================== --- branches/rewrite/pywikibot/families/wikinews_family.py 2013-01-27 12:17:32 UTC (rev 10992) +++ branches/rewrite/pywikibot/families/wikinews_family.py 2013-01-27 12:38:06 UTC (rev 10993) @@ -5,9 +5,9 @@
# The Wikimedia family that is known as Wikinews
-class Family(family.Family): +class Family(family.WikimediaFamily): def __init__(self): - family.Family.__init__(self) + super(Family, self).__init__() self.name = 'wikinews'
self.languages_by_size = [ @@ -18,14 +18,6 @@
self.langs = dict([(lang, '%s.wikinews.org' % lang) for lang in self.languages_by_size])
- - # CentralAuth cross avaliable projects. - self.cross_projects = [ - 'wiktionary', 'wikibooks', 'wikiquote', 'wikisource', 'wikinews', - 'wikiversity', 'meta', 'mediawiki', 'test', 'incubator', 'commons', - 'species', - ] - # Global bot allowed languages on http://meta.wikimedia.org/wiki/Bot_policy/Implementation#Current_implementat... self.cross_allowed = ['ca', 'cs', 'en', 'fa',]
@@ -57,6 +49,3 @@
def code2encoding(self, code): return 'utf-8' - - def shared_image_repository(self, code): - return ('commons', 'commons')
Modified: branches/rewrite/pywikibot/families/wikipedia_family.py =================================================================== --- branches/rewrite/pywikibot/families/wikipedia_family.py 2013-01-27 12:17:32 UTC (rev 10992) +++ branches/rewrite/pywikibot/families/wikipedia_family.py 2013-01-27 12:38:06 UTC (rev 10993) @@ -5,9 +5,9 @@
# The Wikimedia family that is known as Wikipedia, the Free Encyclopedia
-class Family(family.Family): +class Family(family.WikimediaFamily): def __init__(self): - family.Family.__init__(self) + super(Family, self).__init__() self.name = 'wikipedia'
self.languages_by_size = [ @@ -256,13 +256,6 @@ 'test', ]
- # CentralAuth cross avaliable projects. - self.cross_projects = [ - 'wiktionary', 'wikibooks', 'wikiquote', 'wikisource', 'wikinews', - 'wikiversity', 'meta', 'mediawiki', 'test', 'incubator', 'commons', - 'species', 'wikivoyage', - ] - # Global bot allowed languages on # http://meta.wikimedia.org/wiki/Bot_policy/Implementation#Current_implementat... self.cross_allowed = [ @@ -578,9 +571,6 @@ return 'utf-8', 'iso-8859-1' return self.code2encoding(code),
- def shared_image_repository(self, code): - return ('commons', 'commons') - def shared_data_repository(self, code, transcluded=False): if not transcluded or code in ['hu']: return ('wikidata', 'wikidata')
Modified: branches/rewrite/pywikibot/families/wikiquote_family.py =================================================================== --- branches/rewrite/pywikibot/families/wikiquote_family.py 2013-01-27 12:17:32 UTC (rev 10992) +++ branches/rewrite/pywikibot/families/wikiquote_family.py 2013-01-27 12:38:06 UTC (rev 10993) @@ -5,9 +5,9 @@
# The Wikimedia family that is known as Wikiquote
-class Family(family.Family): +class Family(family.WikimediaFamily): def __init__(self): - family.Family.__init__(self) + super(Family, self).__init__() self.name = 'wikiquote'
self.languages_by_size = [ @@ -45,13 +45,6 @@ 'sr', 'su', 'sv', 'te', 'tr', 'uk', 'uz', 'vi', 'zh', 'zh-min-nan', ]
- # CentralAuth cross avaliable projects. - self.cross_projects = [ - 'wiktionary', 'wikibooks', 'wikiquote', 'wikisource', 'wikinews', - 'wikiversity', 'meta', 'mediawiki', 'test', 'incubator', 'commons', - 'species', - ] - # Which languages have a special order for putting interlanguage links, # and what order is it? If a language is not in interwiki_putfirst, # alphabetical order on language code is used. For languages that are in @@ -110,6 +103,3 @@ if code == 'ru': return 'utf-8', 'iso8859-5' return self.code2encoding(code), - - def shared_image_repository(self, code): - return ('commons', 'commons')
Modified: branches/rewrite/pywikibot/families/wikisource_family.py =================================================================== --- branches/rewrite/pywikibot/families/wikisource_family.py 2013-01-27 12:17:32 UTC (rev 10992) +++ branches/rewrite/pywikibot/families/wikisource_family.py 2013-01-27 12:38:06 UTC (rev 10993) @@ -5,9 +5,9 @@
# The Wikimedia family that is known as Wikisource
-class Family(family.Family): +class Family(family.WikimediaFamily): def __init__(self): - family.Family.__init__(self) + super(Family, self).__init__() self.name = 'wikisource'
self.languages_by_size = [ @@ -24,13 +24,6 @@ self.langs['-'] = 'wikisource.org'
- # CentralAuth cross avaliable projects. - self.cross_projects = [ - 'wiktionary', 'wikibooks', 'wikiquote', 'wikisource', 'wikinews', - 'wikiversity', 'meta', 'mediawiki', 'test', 'incubator', 'commons', - 'species', - ] - # Global bot allowed languages on http://meta.wikimedia.org/wiki/Bot_policy/Implementation#Current_implementat... self.cross_allowed = [ 'ca', 'el', 'fa', 'it', 'ko', 'no', 'pl', 'vi', 'zh', @@ -124,6 +117,3 @@ self.crossnamespace[106] = { 'sv': self.authornamespaces, } - - def shared_image_repository(self, code): - return ('commons', 'commons')
Modified: branches/rewrite/pywikibot/families/wikitech_family.py =================================================================== --- branches/rewrite/pywikibot/families/wikitech_family.py 2013-01-27 12:17:32 UTC (rev 10992) +++ branches/rewrite/pywikibot/families/wikitech_family.py 2013-01-27 12:38:06 UTC (rev 10993) @@ -9,14 +9,14 @@ class Family(family.Family):
def __init__(self): - family.Family.__init__(self) + super(Family, self).__init__() self.name = 'wikitech' self.langs = { 'en': 'wikitech.wikimedia.org', }
def version(self, code): - return '1.16wmf4' + return '1.19wmf2'
def scriptpath(self, code): return ''
Modified: branches/rewrite/pywikibot/families/wikiversity_family.py =================================================================== --- branches/rewrite/pywikibot/families/wikiversity_family.py 2013-01-27 12:17:32 UTC (rev 10992) +++ branches/rewrite/pywikibot/families/wikiversity_family.py 2013-01-27 12:38:06 UTC (rev 10993) @@ -5,9 +5,9 @@
# The Wikimedia family that is known as Wikiversity
-class Family(family.Family): +class Family(family.WikimediaFamily): def __init__(self): - family.Family.__init__(self) + super(Family, self).__init__() self.name = 'wikiversity'
self.languages_by_size = [ @@ -17,16 +17,5 @@
self.langs = dict([(lang, '%s.wikiversity.org' % lang) for lang in self.languages_by_size])
- - # CentralAuth cross avaliable projects. - self.cross_projects = [ - 'wiktionary', 'wikibooks', 'wikiquote', 'wikisource', 'wikinews', - 'wikiversity', 'meta', 'mediawiki', 'test', 'incubator', 'commons', - 'species', - ] - # Global bot allowed languages on http://meta.wikimedia.org/wiki/Bot_policy/Implementation#Current_implementat... self.cross_allowed = ['ja',] - - def shared_image_repository(self, code): - return ('commons', 'commons')
Modified: branches/rewrite/pywikibot/families/wikivoyage_family.py =================================================================== --- branches/rewrite/pywikibot/families/wikivoyage_family.py 2013-01-27 12:17:32 UTC (rev 10992) +++ branches/rewrite/pywikibot/families/wikivoyage_family.py 2013-01-27 12:38:06 UTC (rev 10993) @@ -6,9 +6,9 @@
from pywikibot import family
-class Family(family.Family): +class Family(family.WikimediaFamily): def __init__(self): - family.Family.__init__(self) + super(Family, self).__init__() self.name = 'wikivoyage' self.languages_by_size = [ 'de', 'en', 'fr', 'it', 'nl', 'ru', 'sv', 'pt', 'es', @@ -17,10 +17,5 @@ self.langs = dict([(lang, '%s.wikivoyage.org' % lang) for lang in self.languages_by_size])
- } - def scriptpath(self, code): return u'/w' - - def shared_image_repository(self, code): - return ('commons', 'commons')
Modified: branches/rewrite/pywikibot/families/wiktionary_family.py =================================================================== --- branches/rewrite/pywikibot/families/wiktionary_family.py 2013-01-27 12:17:32 UTC (rev 10992) +++ branches/rewrite/pywikibot/families/wiktionary_family.py 2013-01-27 12:38:06 UTC (rev 10993) @@ -5,9 +5,9 @@
# The Wikimedia family that is known as Wiktionary
-class Family(family.Family): +class Family(family.WikimediaFamily): def __init__(self): - family.Family.__init__(self) + super(Family, self).__init__() self.name = 'wiktionary'
self.languages_by_size = [ @@ -30,13 +30,8 @@ self.langs = dict([(lang, '%s.wiktionary.org' % lang) for lang in self.languages_by_size])
- # CentralAuth cross avaliable projects. - self.cross_projects = [ - 'wiktionary', 'wikibooks', 'wikiquote', 'wikisource', 'wikinews', - 'wikiversity', 'meta', 'mediawiki', 'test', 'incubator', 'commons', - 'species', - ]
+ # Global bot allowed languages on # http://meta.wikimedia.org/wiki/Bot_policy/Implementation#Current_implementat... self.cross_allowed = [ @@ -133,6 +128,3 @@ self.interwiki_on_one_line = ['pl']
self.interwiki_attop = ['pl'] - - def shared_image_repository(self, code): - return ('commons', 'commons')
pywikipedia-svn@lists.wikimedia.org