Revision: 6836 Author: alexsh Date: 2009-05-06 03:58:29 +0000 (Wed, 06 May 2009)
Log Message: ----------- setup security connection for meta, mediawiki, species, incubator and commons
Modified Paths: -------------- trunk/pywikipedia/config.py 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/family.py
Modified: trunk/pywikipedia/config.py =================================================================== --- trunk/pywikipedia/config.py 2009-05-05 21:26:13 UTC (rev 6835) +++ trunk/pywikipedia/config.py 2009-05-06 03:58:29 UTC (rev 6836) @@ -70,11 +70,17 @@ # SSL_connection = False
+# Available security projects available_ssl_project = [ - u'wikipedia',u'wikinews',u'wikisource',u'wiktionary',u'wikibooks',u'wikiquote',u'wikiversity' + u'wikipedia',u'wikinews',u'wikisource',u'wiktionary',u'wikibooks',u'wikiquote',u'wikiversity', + u'meta',u'mediawiki',u'commons',u'species',u'incubator' ] - #u'meta',u'mediawiki',u'commons',u'species',u'incubator'] - +#] +# +# +# +# + # password_file = ".passwd" # A password file with default passwords. For more information, please # see LoginManager.readPassword in login.py.
Modified: trunk/pywikipedia/families/commons_family.py =================================================================== --- trunk/pywikipedia/families/commons_family.py 2009-05-05 21:26:13 UTC (rev 6835) +++ trunk/pywikipedia/families/commons_family.py 2009-05-06 03:58:29 UTC (rev 6836) @@ -2,7 +2,7 @@
__version__ = '$Id$'
-import family +import family, config
# The Wikimedia Commons family
@@ -13,6 +13,8 @@ self.langs = { 'commons': 'commons.wikimedia.org', } + if config.SSL_connection and self.name in config.available_ssl_project: + self.langs['commons'] = 'secure.wikimedia.org'
self.namespaces[4] = { '_default': [u'Commons', self.namespaces[4]['_default']], @@ -56,3 +58,9 @@
def shared_image_repository(self, code): return ('commons', 'commons') + + def scriptpath(self, code): + if config.SSL_connection and self.name in config.available_ssl_project: + return '/wikipedia/commons/w' + + return '/w'
Modified: trunk/pywikipedia/families/incubator_family.py =================================================================== --- trunk/pywikipedia/families/incubator_family.py 2009-05-05 21:26:13 UTC (rev 6835) +++ trunk/pywikipedia/families/incubator_family.py 2009-05-06 03:58:29 UTC (rev 6836) @@ -2,7 +2,7 @@
__version__ = '$Id$'
-import family +import family, config
# The Wikimedia Incubator family
@@ -13,6 +13,8 @@ self.langs = { 'incubator': 'incubator.wikimedia.org', } + if config.SSL_connection and self.name in config.available_ssl_project: + self.langs['incubator'] = 'secure.wikimedia.org'
self.namespaces[4] = { '_default': [u'Incubator', self.namespaces[4]['_default']], @@ -28,7 +30,13 @@ }
def version(self, code): - return '1.13alpha' + return '1.15alpha'
def shared_image_repository(self, code): return ('commons', 'commons') + + def scriptpath(self, code): + if config.SSL_connection and self.name in config.available_ssl_project: + return '/wikipedia/incubator/w' + + return '/w'
Modified: trunk/pywikipedia/families/mediawiki_family.py =================================================================== --- trunk/pywikipedia/families/mediawiki_family.py 2009-05-05 21:26:13 UTC (rev 6835) +++ trunk/pywikipedia/families/mediawiki_family.py 2009-05-06 03:58:29 UTC (rev 6836) @@ -2,7 +2,7 @@
__version__ = '$Id$'
-import family +import family, config
# The MediaWiki family # user-config.py: usernames['mediawiki']['mediawiki'] = 'User name' @@ -15,6 +15,8 @@ self.langs = { 'mediawiki': 'www.mediawiki.org', } + if config.SSL_connection and self.name in config.available_ssl_project: + self.langs['mediawiki'] = 'secure.wikimedia.org'
self.namespaces[4] = { '_default': [u'Project', self.namespaces[4]['_default']], @@ -40,3 +42,9 @@
def shared_image_repository(self, code): return ('commons', 'commons') + + def scriptpath(self, code): + if config.SSL_connection and self.name in config.available_ssl_project: + return '/wikipedia/mediawiki/w' + + return '/w'
Modified: trunk/pywikipedia/families/meta_family.py =================================================================== --- trunk/pywikipedia/families/meta_family.py 2009-05-05 21:26:13 UTC (rev 6835) +++ trunk/pywikipedia/families/meta_family.py 2009-05-06 03:58:29 UTC (rev 6836) @@ -2,7 +2,7 @@
__version__ = '$Id$'
-import family +import family, config
# The meta wikimedia family
@@ -13,7 +13,10 @@ self.langs = { 'meta': 'meta.wikimedia.org', } - + + if config.SSL_connection and self.name in config.available_ssl_project: + self.langs ['meta'] = 'secure.wikimedia.org' + self.namespaces[4] = { '_default': [u'Meta', self.namespaces[4]['_default']], } @@ -126,7 +129,13 @@ self.interwiki_forward = 'wikipedia'
def version(self,code): - return '1.13alpha' + return '1.15alpha'
def shared_image_repository(self, code): return ('commons', 'commons') + + def scriptpath(self, code): + if config.SSL_connection and self.name in config.available_ssl_project: + return '/wikipedia/meta/w' + + return '/w'
Modified: trunk/pywikipedia/families/species_family.py =================================================================== --- trunk/pywikipedia/families/species_family.py 2009-05-05 21:26:13 UTC (rev 6835) +++ trunk/pywikipedia/families/species_family.py 2009-05-06 03:58:29 UTC (rev 6836) @@ -2,7 +2,7 @@
__version__ = '$Id$'
-import family +import family, config
# The wikispecies family
@@ -13,6 +13,8 @@ self.langs = { 'species': 'species.wikimedia.org', } + if config.SSL_connection and self.name in config.available_ssl_project: + self.langs['species'] = 'secure.wikimedia.org'
self.namespaces[4] = { '_default': [u'Wikispecies', self.namespaces[4]['_default']], @@ -24,7 +26,13 @@ self.interwiki_forward = 'wikipedia'
def version(self,code): - return '1.13alpha' + return '1.15alpha'
def shared_image_repository(self, code): return ('commons', 'commons') + + def scriptpath(self, code): + if config.SSL_connection and self.name in config.available_ssl_project: + return '/wikipedia/species/w' + + return '/w'
Modified: trunk/pywikipedia/family.py =================================================================== --- trunk/pywikipedia/family.py 2009-05-05 21:26:13 UTC (rev 6835) +++ trunk/pywikipedia/family.py 2009-05-06 03:58:29 UTC (rev 6836) @@ -3414,9 +3414,9 @@ """ if config.SSL_connection and self.name in config.available_ssl_project: return 'https' - else: - return 'http'
+ return 'http' + def hostname(self, code): return self.langs[code]
@@ -3434,9 +3434,9 @@ """ if config.SSL_connection and self.name in config.available_ssl_project: return '/%s/%s/w' % (self.name, code) - else: - return '/w'
+ return '/w' + def path(self, code): return '%s/index.php' % self.scriptpath(code)
@@ -3449,8 +3449,8 @@ def nicepath(self, code): if config.SSL_connection and self.name in config.available_ssl_project: return '/%s/%s/wiki/' % (self.name, code) - else: - return '/wiki/' + + return '/wiki/'
def dbName(self, code): # returns the name of the MySQL database