http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10214
Revision: 10214 Author: shizhao Date: 2012-05-15 14:16:54 +0000 (Tue, 15 May 2012) Log Message: ----------- Wikimedia family update SSL connection and clean code
Modified Paths: -------------- trunk/pywikipedia/families/incubator_family.py trunk/pywikipedia/families/mediawiki_family.py trunk/pywikipedia/families/meta_family.py trunk/pywikipedia/families/species_family.py trunk/pywikipedia/families/strategy_family.py trunk/pywikipedia/families/wikibooks_family.py trunk/pywikipedia/families/wikinews_family.py trunk/pywikipedia/families/wikipedia_family.py trunk/pywikipedia/families/wikiquote_family.py trunk/pywikipedia/families/wikisource_family.py trunk/pywikipedia/families/wikiversity_family.py trunk/pywikipedia/families/wiktionary_family.py
Modified: trunk/pywikipedia/families/incubator_family.py =================================================================== --- trunk/pywikipedia/families/incubator_family.py 2012-05-13 16:36:57 UTC (rev 10213) +++ trunk/pywikipedia/families/incubator_family.py 2012-05-15 14:16:54 UTC (rev 10214) @@ -13,9 +13,6 @@ self.langs = { 'incubator': 'incubator.wikimedia.org', } - if family.config.SSL_connection: - self.langs['incubator'] = None - self.namespaces[4] = { '_default': [u'Incubator', u'I', self.namespaces[4]['_default']], } @@ -44,15 +41,6 @@ return ('commons', 'commons')
if family.config.SSL_connection: - def hostname(self, code): - return 'secure.wikimedia.org'
def protocol(self, code): - return 'https' - - def scriptpath(self, code): - return '/wikipedia/incubator/w' - - def nicepath(self, code): - return '/wikipedia/incubator/wiki/' - + return 'https' \ No newline at end of file
Modified: trunk/pywikipedia/families/mediawiki_family.py =================================================================== --- trunk/pywikipedia/families/mediawiki_family.py 2012-05-13 16:36:57 UTC (rev 10213) +++ trunk/pywikipedia/families/mediawiki_family.py 2012-05-15 14:16:54 UTC (rev 10214) @@ -15,8 +15,6 @@ self.langs = { 'mediawiki': 'www.mediawiki.org', } - if family.config.SSL_connection: - self.langs['mediawiki'] = None
self.namespaces[4] = { '_default': [u'Project', self.namespaces[4]['_default']], @@ -70,14 +68,6 @@ return ('commons', 'commons')
if family.config.SSL_connection: - def hostname(self, code): - return 'secure.wikimedia.org'
def protocol(self, code): - return 'https' - - def scriptpath(self, code): - return '/wikipedia/mediawiki/w' - - def nicepath(self, code): - return '/wikipedia/mediawiki/wiki/' + return 'https' \ No newline at end of file
Modified: trunk/pywikipedia/families/meta_family.py =================================================================== --- trunk/pywikipedia/families/meta_family.py 2012-05-13 16:36:57 UTC (rev 10213) +++ trunk/pywikipedia/families/meta_family.py 2012-05-15 14:16:54 UTC (rev 10214) @@ -14,9 +14,6 @@ 'meta': 'meta.wikimedia.org', }
- if family.config.SSL_connection: - self.langs ['meta'] = None - self.namespaces[4] = { '_default': [u'Meta', self.namespaces[4]['_default']], } @@ -163,14 +160,6 @@ return ('commons', 'commons')
if family.config.SSL_connection: - def hostname(self, code): - return 'secure.wikimedia.org'
def protocol(self, code): - return 'https' - - def scriptpath(self, code): - return '/wikipedia/meta/w' - - def nicepath(self, code): - return '/wikipedia/meta/wiki/' + return 'https' \ No newline at end of file
Modified: trunk/pywikipedia/families/species_family.py =================================================================== --- trunk/pywikipedia/families/species_family.py 2012-05-13 16:36:57 UTC (rev 10213) +++ trunk/pywikipedia/families/species_family.py 2012-05-15 14:16:54 UTC (rev 10214) @@ -13,8 +13,6 @@ self.langs = { 'species': 'species.wikimedia.org', } - if family.config.SSL_connection: - self.langs['species'] = None
self.namespaces[4] = { '_default': [u'Wikispecies', self.namespaces[4]['_default']], @@ -34,14 +32,6 @@ return ('commons', 'commons')
if family.config.SSL_connection: - def hostname(self, code): - return 'secure.wikimedia.org'
def protocol(self, code): - return 'https' - - def scriptpath(self, code): - return '/wikipedia/species/w' - - def nicepath(self, code): - return '/wikipedia/species/wiki/' + return 'https' \ No newline at end of file
Modified: trunk/pywikipedia/families/strategy_family.py =================================================================== --- trunk/pywikipedia/families/strategy_family.py 2012-05-13 16:36:57 UTC (rev 10213) +++ trunk/pywikipedia/families/strategy_family.py 2012-05-15 14:16:54 UTC (rev 10214) @@ -13,8 +13,6 @@ self.langs = { 'strategy': 'strategy.wikimedia.org', } - if config.SSL_connection: - self.langs['strategy'] = None
self.namespaces[4] = { '_default': [u'Strategic Planning', 'Project'], @@ -38,14 +36,6 @@ return ('commons', 'commons')
if config.SSL_connection: - def hostname(self, code): - return 'secure.wikimedia.org'
def protocol(self, code): - return 'https' - - def scriptpath(self, code): - return '/wikipedia/strategy/w' - - def nicepath(self, code): - return '/wikipedia/strategy/wiki/' + return 'https' \ No newline at end of file
Modified: trunk/pywikipedia/families/wikibooks_family.py =================================================================== --- trunk/pywikipedia/families/wikibooks_family.py 2012-05-13 16:36:57 UTC (rev 10213) +++ trunk/pywikipedia/families/wikibooks_family.py 2012-05-15 14:16:54 UTC (rev 10214) @@ -21,10 +21,7 @@ 'ast', 'ku', 'tk', 'uz', 'su', 'vo', 'mn', 'my', ]
- if family.config.SSL_connection: - self.langs = dict([(lang, None) for lang in self.languages_by_size]) - else: - self.langs = dict([(lang, '%s.wikibooks.org' % lang) for lang in self.languages_by_size]) + self.langs = dict([(lang, '%s.wikibooks.org' % lang) for lang in self.languages_by_size])
# Override defaults self.namespaces[3]['fr'] = [u'Discussion utilisateur', u'Discussion Utilisateur'] @@ -495,14 +492,6 @@ return ('commons', 'commons')
if family.config.SSL_connection: - def hostname(self, code): - return 'secure.wikimedia.org'
def protocol(self, code): - return 'https' - - def scriptpath(self, code): - return '/%s/%s/w' % (self.name, code) - - def nicepath(self, code): - return '/%s/%s/wiki/' % (self.name, code) + return 'https' \ No newline at end of file
Modified: trunk/pywikipedia/families/wikinews_family.py =================================================================== --- trunk/pywikipedia/families/wikinews_family.py 2012-05-13 16:36:57 UTC (rev 10213) +++ trunk/pywikipedia/families/wikinews_family.py 2012-05-15 14:16:54 UTC (rev 10214) @@ -16,10 +16,7 @@ 'tr', 'sd', 'sq', 'uk', 'no', 'bs', 'eo', 'ko', ]
- if family.config.SSL_connection: - self.langs = dict([(lang, None) for lang in self.languages_by_size]) - else: - self.langs = dict([(lang, '%s.wikinews.org' % lang) for lang in self.languages_by_size]) + self.langs = dict([(lang, '%s.wikinews.org' % lang) for lang in self.languages_by_size])
# Override defaults self.namespaces[14]['en'] = [u'Category', u'CAT'] @@ -280,14 +277,6 @@ return ('commons', 'commons')
if family.config.SSL_connection: - def hostname(self, code): - return 'secure.wikimedia.org'
def protocol(self, code): - return 'https' - - def scriptpath(self, code): - return '/%s/%s/w' % (self.name, code) - - def nicepath(self, code): - return '/%s/%s/wiki/' % (self.name, code) + return 'https' \ No newline at end of file
Modified: trunk/pywikipedia/families/wikipedia_family.py =================================================================== --- trunk/pywikipedia/families/wikipedia_family.py 2012-05-13 16:36:57 UTC (rev 10213) +++ trunk/pywikipedia/families/wikipedia_family.py 2012-05-15 14:16:54 UTC (rev 10214) @@ -41,10 +41,7 @@ 'ch', 'ff', 'ny', 'xh', 'tw', ]
- if family.config.SSL_connection: - self.langs = dict([(lang, None) for lang in self.languages_by_size]) - else: - self.langs = dict([(lang, '%s.wikipedia.org' % lang) for lang in self.languages_by_size]) + self.langs = dict([(lang, '%s.wikipedia.org' % lang) for lang in self.languages_by_size])
# Override defaults self.namespaces[1]['ja'] = [u'ノート', u'トーク'] @@ -1502,14 +1499,6 @@ return ('commons', 'commons')
if family.config.SSL_connection: - def hostname(self, code): - return 'secure.wikimedia.org'
def protocol(self, code): - return 'https' - - def scriptpath(self, code): - return '/%s/%s/w' % (self.name, code) - - def nicepath(self, code): - return '/%s/%s/wiki/' % (self.name, code) + return 'https' \ No newline at end of file
Modified: trunk/pywikipedia/families/wikiquote_family.py =================================================================== --- trunk/pywikipedia/families/wikiquote_family.py 2012-05-13 16:36:57 UTC (rev 10213) +++ trunk/pywikipedia/families/wikiquote_family.py 2012-05-15 14:16:54 UTC (rev 10214) @@ -20,10 +20,7 @@ 'wo', 'ky', 'am', 'co', ]
- if family.config.SSL_connection: - self.langs = dict([(lang, None) for lang in self.languages_by_size]) - else: - self.langs = dict([(lang, '%s.wikiquote.org' % lang) for lang in self.languages_by_size]) + self.langs = dict([(lang, '%s.wikiquote.org' % lang) for lang in self.languages_by_size])
# Override defaults self.namespaces[3]['fr'] = [u'Discussion utilisateur', u'Discussion Utilisateur'] @@ -353,14 +350,6 @@ return ('commons', 'commons')
if family.config.SSL_connection: - def hostname(self, code): - return 'secure.wikimedia.org'
def protocol(self, code): - return 'https' - - def scriptpath(self, code): - return '/%s/%s/w' % (self.name, code) - - def nicepath(self, code): - return '/%s/%s/wiki/' % (self.name, code) + return 'https' \ No newline at end of file
Modified: trunk/pywikipedia/families/wikisource_family.py =================================================================== --- trunk/pywikipedia/families/wikisource_family.py 2012-05-13 16:36:57 UTC (rev 10213) +++ trunk/pywikipedia/families/wikisource_family.py 2012-05-15 14:16:54 UTC (rev 10214) @@ -19,14 +19,9 @@ 'kn', 'mr', 'cy', 'zh-min-nan', 'sk', 'fo', ]
- if family.config.SSL_connection: - for lang in self.languages_by_size: - self.langs[lang] = None - self.langs['-'] = None - else: - for lang in self.languages_by_size: - self.langs[lang] = '%s.wikisource.org' % lang - self.langs['-'] = 'wikisource.org' + for lang in self.languages_by_size: + self.langs[lang] = '%s.wikisource.org' % lang + self.langs['-'] = 'wikisource.org'
# Override defaults self.namespaces[10]['zh'] = [u'Template', u'模板', u'样板', u'樣板'] @@ -631,19 +626,6 @@ return ('commons', 'commons')
if family.config.SSL_connection: - def hostname(self, code): - return 'secure.wikimedia.org'
def protocol(self, code): - return 'https' - - def scriptpath(self, code): - if code == '-': - return '/wikipedia/sources/w' - - return '/%s/%s/w' % (self.name, code) - - def nicepath(self, code): - if code == '-': - return '/wikipedia/sources/wiki/' - return '/%s/%s/wiki/' % (self.name, code) + return 'https' \ No newline at end of file
Modified: trunk/pywikipedia/families/wikiversity_family.py =================================================================== --- trunk/pywikipedia/families/wikiversity_family.py 2012-05-13 16:36:57 UTC (rev 10213) +++ trunk/pywikipedia/families/wikiversity_family.py 2012-05-15 14:16:54 UTC (rev 10214) @@ -15,10 +15,7 @@ 'fi', 'sv', 'sl', 'ja', ]
- if family.config.SSL_connection: - self.langs = dict([(lang, None) for lang in self.languages_by_size]) - else: - self.langs = dict([(lang, '%s.wikiversity.org' % lang) for lang in self.languages_by_size]) + self.langs = dict([(lang, '%s.wikiversity.org' % lang) for lang in self.languages_by_size])
# Override defaults self.namespaces[3]['cs'] = [u'Diskuse s uživatelem', u'Uživatel diskuse', u'Uživatelka diskuse', u'Diskuse s uživatelkou'] @@ -165,14 +162,6 @@ return ('commons', 'commons')
if family.config.SSL_connection: - def hostname(self, code): - return 'secure.wikimedia.org'
def protocol(self, code): - return 'https' - - def scriptpath(self, code): - return '/%s/%s/w' % (self.name, code) - - def nicepath(self, code): - return '/%s/%s/wiki/' % (self.name, code) + return 'https' \ No newline at end of file
Modified: trunk/pywikipedia/families/wiktionary_family.py =================================================================== --- trunk/pywikipedia/families/wiktionary_family.py 2012-05-13 16:36:57 UTC (rev 10213) +++ trunk/pywikipedia/families/wiktionary_family.py 2012-05-15 14:16:54 UTC (rev 10214) @@ -27,10 +27,7 @@ 'jbo', 'dv', 'ne', 'ha', 'ks', 'ay', 'ts', 'dz', ]
- if family.config.SSL_connection: - self.langs = dict([(lang, None) for lang in self.languages_by_size]) - else: - self.langs = dict([(lang, '%s.wiktionary.org' % lang) for lang in self.languages_by_size]) + self.langs = dict([(lang, '%s.wiktionary.org' % lang) for lang in self.languages_by_size])
# Override defaults self.namespaces[3]['eo'] = [u'Uzanta diskuto', u'Vikipediista diskuto', u'Uzula diskuto'] @@ -697,14 +694,6 @@ return ('commons', 'commons')
if family.config.SSL_connection: - def hostname(self, code): - return 'secure.wikimedia.org'
def protocol(self, code): - return 'https' - - def scriptpath(self, code): - return '/%s/%s/w' % (self.name, code) - - def nicepath(self, code): - return '/%s/%s/wiki/' % (self.name, code) + return 'https' \ No newline at end of file
pywikipedia-svn@lists.wikimedia.org