Revision: 7030 Author: alexsh Date: 2009-07-08 03:14:04 +0000 (Wed, 08 Jul 2009)
Log Message: ----------- Wikimedia families update: * remove config.available_ssl_project (not necessary now, config.SSL_connection is enough to define http or https ) * set hostname function to secure.wm when config.SSL_connection is true. * update wikibooks obsolete info.
family.py and config.py in next rev.
Modified Paths: -------------- trunk/pywikipedia/families/commons_family.py 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/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/commons_family.py =================================================================== --- trunk/pywikipedia/families/commons_family.py 2009-07-07 20:14:05 UTC (rev 7029) +++ trunk/pywikipedia/families/commons_family.py 2009-07-08 03:14:04 UTC (rev 7030) @@ -13,7 +13,7 @@ self.langs = { 'commons': 'commons.wikimedia.org', } - if config.SSL_connection and self.name in config.available_ssl_project: + if config.SSL_connection: self.langs['commons'] = 'secure.wikimedia.org'
self.namespaces[4] = { @@ -63,7 +63,7 @@ return ('commons', 'commons')
def scriptpath(self, code): - if config.SSL_connection and self.name in config.available_ssl_project: + if config.SSL_connection: return '/wikipedia/commons/w'
return '/w'
Modified: trunk/pywikipedia/families/incubator_family.py =================================================================== --- trunk/pywikipedia/families/incubator_family.py 2009-07-07 20:14:05 UTC (rev 7029) +++ trunk/pywikipedia/families/incubator_family.py 2009-07-08 03:14:04 UTC (rev 7030) @@ -13,7 +13,7 @@ self.langs = { 'incubator': 'incubator.wikimedia.org', } - if config.SSL_connection and self.name in config.available_ssl_project: + if config.SSL_connection: self.langs['incubator'] = 'secure.wikimedia.org'
self.namespaces[4] = { @@ -36,7 +36,7 @@ return ('commons', 'commons')
def scriptpath(self, code): - if config.SSL_connection and self.name in config.available_ssl_project: + if config.SSL_connection: return '/wikipedia/incubator/w'
return '/w'
Modified: trunk/pywikipedia/families/mediawiki_family.py =================================================================== --- trunk/pywikipedia/families/mediawiki_family.py 2009-07-07 20:14:05 UTC (rev 7029) +++ trunk/pywikipedia/families/mediawiki_family.py 2009-07-08 03:14:04 UTC (rev 7030) @@ -15,7 +15,7 @@ self.langs = { 'mediawiki': 'www.mediawiki.org', } - if config.SSL_connection and self.name in config.available_ssl_project: + if config.SSL_connection: self.langs['mediawiki'] = 'secure.wikimedia.org'
self.namespaces[4] = { @@ -44,7 +44,7 @@ return ('commons', 'commons')
def scriptpath(self, code): - if config.SSL_connection and self.name in config.available_ssl_project: + if config.SSL_connection: return '/wikipedia/mediawiki/w'
return '/w'
Modified: trunk/pywikipedia/families/meta_family.py =================================================================== --- trunk/pywikipedia/families/meta_family.py 2009-07-07 20:14:05 UTC (rev 7029) +++ trunk/pywikipedia/families/meta_family.py 2009-07-08 03:14:04 UTC (rev 7030) @@ -14,7 +14,7 @@ 'meta': 'meta.wikimedia.org', }
- if config.SSL_connection and self.name in config.available_ssl_project: + if config.SSL_connection: self.langs ['meta'] = 'secure.wikimedia.org'
self.namespaces[4] = { @@ -136,7 +136,7 @@ return ('commons', 'commons')
def scriptpath(self, code): - if config.SSL_connection and self.name in config.available_ssl_project: + if config.SSL_connection: return '/wikipedia/meta/w'
return '/w'
Modified: trunk/pywikipedia/families/species_family.py =================================================================== --- trunk/pywikipedia/families/species_family.py 2009-07-07 20:14:05 UTC (rev 7029) +++ trunk/pywikipedia/families/species_family.py 2009-07-08 03:14:04 UTC (rev 7030) @@ -13,7 +13,7 @@ self.langs = { 'species': 'species.wikimedia.org', } - if config.SSL_connection and self.name in config.available_ssl_project: + if config.SSL_connection: self.langs['species'] = 'secure.wikimedia.org'
self.namespaces[4] = { @@ -32,7 +32,7 @@ return ('commons', 'commons')
def scriptpath(self, code): - if config.SSL_connection and self.name in config.available_ssl_project: + if config.SSL_connection: return '/wikipedia/species/w'
return '/w'
Modified: trunk/pywikipedia/families/wikibooks_family.py =================================================================== --- trunk/pywikipedia/families/wikibooks_family.py 2009-07-07 20:14:05 UTC (rev 7029) +++ trunk/pywikipedia/families/wikibooks_family.py 2009-07-08 03:14:04 UTC (rev 7030) @@ -24,9 +24,9 @@ 'ps', 'xh', 'kk', 'za', 'nds', 'wa', 'zu', 'my', ]
- if config.SSL_connection and config.family in config.available_ssl_project: + if config.SSL_connection: for lang in self.languages_by_size: - self.langs[lang] = 'secure.wikimedia.org' + self.langs[lang] = None else: for lang in self.languages_by_size: self.langs[lang] = '%s.wikibooks.org' % lang @@ -314,17 +314,23 @@ 'gn': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Gua... 'gu': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Guj... 'jp': 'ja', + 'km': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Khm... 'ks': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Kas... + 'lb': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_L%C... 'ln': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Lin... + 'lv': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Lat... 'mi': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Mao... 'minnan':'zh-min-nan', 'nah': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Nah... 'nb': 'no', + 'ps': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Pas... 'qu': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Que... 'rm': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Rum... 'se': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Sam... 'tokipona': None, 'ug': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Uyg... + 'wa': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Wal... + 'xh': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Xho... 'yo': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Yor... 'zh-tw': 'zh', 'zh-cn': 'zh' @@ -342,8 +348,13 @@ # Global bot allowed languages on http://meta.wikimedia.org/wiki/Bot_policy/Implementation#Current_implementat... self.cross_allowed = ['fa', 'fy', 'it', 'ru', 'simple', 'zh']
+ if config.SSL_connection: + def hostname(self, code): + return 'secure.wikimedia.org' + def version(self, code): return '1.16alpha'
def shared_image_repository(self, code): return ('commons', 'commons') +
Modified: trunk/pywikipedia/families/wikinews_family.py =================================================================== --- trunk/pywikipedia/families/wikinews_family.py 2009-07-07 20:14:05 UTC (rev 7029) +++ trunk/pywikipedia/families/wikinews_family.py 2009-07-08 03:14:04 UTC (rev 7030) @@ -17,9 +17,9 @@ 'ca', 'hu', 'ro', 'th', 'bs', 'bg', 'ta', ]
- if config.SSL_connection and self.name in config.available_ssl_project: + if config.SSL_connection: for lang in self.languages_by_size: - self.langs[lang] = 'secure.wikimedia.org' + self.langs[lang] = None else: for lang in self.languages_by_size: self.langs[lang] = '%s.wikinews.org' % lang @@ -193,8 +193,12 @@ def code2encoding(self, code): return 'utf-8'
+ if config.SSL_connection: + def hostname(self, code): + return 'secure.wikimedia.org' + def version(self, code): return '1.16alpha'
def shared_image_repository(self, code): - return ('commons', 'commons') + return ('commons', 'commons') \ No newline at end of file
Modified: trunk/pywikipedia/families/wikipedia_family.py =================================================================== --- trunk/pywikipedia/families/wikipedia_family.py 2009-07-07 20:14:05 UTC (rev 7029) +++ trunk/pywikipedia/families/wikipedia_family.py 2009-07-08 03:14:04 UTC (rev 7030) @@ -40,9 +40,9 @@ 'rn', 'ki', 'lg', 'tum', 'ng', ]
- if config.SSL_connection and self.name in config.available_ssl_project: + if config.SSL_connection: for lang in self.languages_by_size: - self.langs[lang] = 'secure.wikimedia.org' + self.langs[lang] = None else: for lang in self.languages_by_size: self.langs[lang] = '%s.wikipedia.org' % lang @@ -1122,3 +1122,7 @@
def shared_image_repository(self, code): return ('commons', 'commons') + + if config.SSL_connection: + def hostname(self, code): + return 'secure.wikimedia.org' \ No newline at end of file
Modified: trunk/pywikipedia/families/wikiquote_family.py =================================================================== --- trunk/pywikipedia/families/wikiquote_family.py 2009-07-07 20:14:05 UTC (rev 7029) +++ trunk/pywikipedia/families/wikiquote_family.py 2009-07-08 03:14:04 UTC (rev 7030) @@ -22,9 +22,9 @@ 'am', 'co', 'kk', ]
- if config.SSL_connection and self.name in config.available_ssl_project: + if config.SSL_connection: for lang in self.languages_by_size: - self.langs[lang] = 'secure.wikimedia.org' + self.langs[lang] = None else: for lang in self.languages_by_size: self.langs[lang] = '%s.wikiquote.org' % lang @@ -263,6 +263,10 @@ 'zh-cn': 'zh' }
+ if config.SSL_connection: + def hostname(self, code): + return 'secure.wikimedia.org' + def version(self, code): return '1.16alpha'
@@ -278,4 +282,4 @@ return self.code2encoding(code),
def shared_image_repository(self, code): - return ('commons', 'commons') + return ('commons', 'commons') \ No newline at end of file
Modified: trunk/pywikipedia/families/wikisource_family.py =================================================================== --- trunk/pywikipedia/families/wikisource_family.py 2009-07-07 20:14:05 UTC (rev 7029) +++ trunk/pywikipedia/families/wikisource_family.py 2009-07-08 03:14:04 UTC (rev 7030) @@ -20,10 +20,10 @@ 'sk', 'zh-min-nan', 'fo', ]
- if config.SSL_connection and self.name in config.available_ssl_project: + if config.SSL_connection: for lang in self.languages_by_size: - self.langs[lang] = 'secure.wikimedia.org' - self.langs['-'] = 'secure.wikimedia.org' + self.langs[lang] = None + self.langs['-'] = None else: for lang in self.languages_by_size: self.langs[lang] = '%s.wikisource.org' % lang @@ -354,14 +354,17 @@ if config.SSL_connection: if code == '-': return '/wikipedia/sources/w' - else: - return '/%s/%s/w' % (self.name, code) - else: - return '/w' + + return '/%s/%s/w' % (self.name, code) + + return '/w'
+ if config.SSL_connection: + def hostname(self, code): + return 'secure.wikimedia.org' + def version(self, code): return '1.16alpha'
def shared_image_repository(self, code): - return ('commons', 'commons') - + return ('commons', 'commons') \ No newline at end of file
Modified: trunk/pywikipedia/families/wikiversity_family.py =================================================================== --- trunk/pywikipedia/families/wikiversity_family.py 2009-07-07 20:14:05 UTC (rev 7029) +++ trunk/pywikipedia/families/wikiversity_family.py 2009-07-08 03:14:04 UTC (rev 7030) @@ -16,9 +16,9 @@ 'ja', ]
- if config.SSL_connection and self.name in config.available_ssl_project: + if config.SSL_connection: for lang in self.languages_by_size: - self.langs[lang] = 'secure.wikimedia.org' + self.langs[lang] = None else: for lang in self.languages_by_size: self.langs[lang] = '%s.wikiversity.org' % lang @@ -119,8 +119,12 @@ 'ja', ]
+ if config.SSL_connection: + def hostname(self, code): + return 'secure.wikimedia.org' + def version(self,code): return '1.16alpha'
def shared_image_repository(self, code): - return ('commons', 'commons') + return ('commons', 'commons') \ No newline at end of file
Modified: trunk/pywikipedia/families/wiktionary_family.py =================================================================== --- trunk/pywikipedia/families/wiktionary_family.py 2009-07-07 20:14:05 UTC (rev 7029) +++ trunk/pywikipedia/families/wiktionary_family.py 2009-07-08 03:14:04 UTC (rev 7030) @@ -30,9 +30,9 @@ ]
- if config.SSL_connection and self.name in config.available_ssl_project: + if config.SSL_connection: for lang in self.languages_by_size: - self.langs[lang] = 'secure.wikimedia.org' + self.langs[lang] = None else: for lang in self.languages_by_size: self.langs[lang] = '%s.wiktionary.org' % lang @@ -449,8 +449,13 @@
self.interwiki_attop = ['pl']
+ if config.SSL_connection: + def hostname(self, code): + return 'secure.wikimedia.org' + def version(self, code): return '1.16alpha'
def shared_image_repository(self, code): return ('commons', 'commons') +
pywikipedia-svn@lists.wikimedia.org