Revision: 5066 Author: russblau Date: 2008-02-21 19:42:30 +0000 (Thu, 21 Feb 2008)
Log Message: ----------- Add scriptpath() method to family objects; update family files where needed, and delete 3 families that appear no longer to exist.
Modified Paths: -------------- trunk/pywikipedia/families/anarchopedia_family.py trunk/pywikipedia/families/betawiki_family.py trunk/pywikipedia/families/botwiki_family.py trunk/pywikipedia/families/freeciv_family.py trunk/pywikipedia/families/gentoo_family.py trunk/pywikipedia/families/krefeldwiki_family.py trunk/pywikipedia/families/loveto_family.py trunk/pywikipedia/families/lyricwiki_family.py trunk/pywikipedia/families/mac_wikicities_family.py trunk/pywikipedia/families/mdc_family.py trunk/pywikipedia/families/memoryalpha_family.py trunk/pywikipedia/families/mozilla_family.py trunk/pywikipedia/families/openttd_family.py trunk/pywikipedia/families/pakanto_family.py trunk/pywikipedia/families/southernapproach_family.py trunk/pywikipedia/families/supertux_family.py trunk/pywikipedia/families/uncyclopedia_family.py trunk/pywikipedia/families/wikibond_family.py trunk/pywikipedia/families/wikitech_family.py trunk/pywikipedia/families/wikitravel_family.py trunk/pywikipedia/families/wikitravel_shared_family.py trunk/pywikipedia/family.py
Removed Paths: ------------- trunk/pywikipedia/families/jediarchives_family.py trunk/pywikipedia/families/linpedia_family.py trunk/pywikipedia/families/mediapedia_family.py
Modified: trunk/pywikipedia/families/anarchopedia_family.py =================================================================== --- trunk/pywikipedia/families/anarchopedia_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/anarchopedia_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -118,5 +118,5 @@ def version(self, code): return "1.12alpha"
- def path(self, code): - return '/index.php' + def scriptpath(self, code): + return ''
Modified: trunk/pywikipedia/families/betawiki_family.py =================================================================== --- trunk/pywikipedia/families/betawiki_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/betawiki_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -25,5 +25,10 @@ def version(self, code): return "1.5.4" #The MediaWiki version used. Not very important in most cases.
- def path(self, code): - return '/beta/index.php' #The path of index.php + def scriptpath(self, code): + return '/beta' #The value of {{SCRIPTPATH}} on this wiki + + def apipath(self, code): + # Betawiki uses old, pre-API MediaWiki version + raise NotImplementedError( + "The %s family does not support api.php" % self.name)
Modified: trunk/pywikipedia/families/botwiki_family.py =================================================================== --- trunk/pywikipedia/families/botwiki_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/botwiki_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -64,6 +64,3 @@
def version(self, code): return "1.11.0" - - def path(self, code): - return '/w/index.php'
Modified: trunk/pywikipedia/families/freeciv_family.py =================================================================== --- trunk/pywikipedia/families/freeciv_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/freeciv_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -43,8 +43,8 @@ '_default': u'Forum talk', }
- def path(self, code): - return '/index.php' + def scriptpath(self, code): + return ''
def version(self, code): return "1.10alpha"
Modified: trunk/pywikipedia/families/gentoo_family.py =================================================================== --- trunk/pywikipedia/families/gentoo_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/gentoo_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -64,11 +64,16 @@
self.known_families.pop('gentoo-wiki')
- def path(self, code): - return '/index.php' + def scriptpath(self, code): + return ''
+ def apipath(self, code): + # API not implemented on this wiki + raise NotImplementedError( + "The %s family does not yet support api.php." % self.name()) + def nicepath(self, code): return '/'
def version(self, code): - return "1.9alpha" \ No newline at end of file + return "1.9alpha"
Deleted: trunk/pywikipedia/families/jediarchives_family.py =================================================================== --- trunk/pywikipedia/families/jediarchives_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/jediarchives_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- - -import family - -# Jedi Archives, a Star Wars wiki. - -class Family(family.Family): - def __init__(self): - family.Family.__init__(self) - self.name = 'jediarchives' - self.langs = { - 'en': 'jediarchives.info', - } - self.namespaces[4] = { - '_default': [u'JediArchives', self.namespaces[4]['_default']], - } - self.namespaces[5] = { - '_default': [u'JediArchives talk', self.namespaces[5]['_default']], - } - - def version(self, code): - return "1.5.3" - - def path(self, code): - return '/wiki/index.php' -
Modified: trunk/pywikipedia/families/krefeldwiki_family.py =================================================================== --- trunk/pywikipedia/families/krefeldwiki_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/krefeldwiki_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -57,5 +57,8 @@ def version(self, code): return "1.10.1"
+ def scriptpath(self, code): + return '/w' + def path(self, code): - return '/w/index.php5' + return '%s/index.php5' % self.scriptpath(code)
Deleted: trunk/pywikipedia/families/linpedia_family.py =================================================================== --- trunk/pywikipedia/families/linpedia_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/linpedia_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -import family, config - -# Linpedia.org, the GNU/Linux encyclopedia - -class Family(family.Family): - - def __init__(self): - family.Family.__init__(self) - self.name = 'linpedia' - - self.langs = { - 'en':'www.linpedia.org', - } - -# Namespaces - - self.namespaces[4] = { - '_default': [u'Linpedia', self.namespaces[4]['_default']], - } - self.namespaces[5] = { - '_default': [u'Linpedia talk', self.namespaces[5]['_default']], - } - - def version(self, code): - return "1.4" - - def path(self, code): - return '/wiki/index.php'
Modified: trunk/pywikipedia/families/loveto_family.py =================================================================== --- trunk/pywikipedia/families/loveto_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/loveto_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import family - + # The Lovetoknow internal family, for lovetoknow wikis, including those # not yet open to the public.
@@ -68,16 +68,20 @@
self.disambcatname = { '1911': 'Disambiguation',} - - def path(self, code): + + def scriptpath(self, code): if code in ['1911','shoes','insurance','makeup','skincare','lingerie', 'mortgage','interiordesign','tattoos','hair','dating', 'cellphones','college','yoga','celebrity','sunglasses', 'divorce','creditcards','cats','swimsuits']: - return '/index.php' + return '' else: - return '/w/index.php' + return '/w'
+ def apipath(self, code): + raise NotImplementedError( + "The lovetoknow family does not support api.php") + def nice_get_address(self, code, name): if code in ['recipes','garden','guru']: return '/wiki/%s' % (name) @@ -86,7 +90,7 @@
# Which version of MediaWiki is used? def version(self, code): - return "1.4.5" + return "1.8.2"
def hostname(self,code): if code == '1911':
Modified: trunk/pywikipedia/families/lyricwiki_family.py =================================================================== --- trunk/pywikipedia/families/lyricwiki_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/lyricwiki_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -2,7 +2,7 @@
import family
-# The LiricWiki family +# The LyricWiki family
# user_config.py: # usernames['lyricwiki']['en'] = 'user' @@ -14,7 +14,7 @@ self.langs = { 'en': 'www.lyricwiki.org', } - + self.namespaces[4] = { '_default': [u'LyricWiki', self.namespaces[4]['_default']], } @@ -25,5 +25,9 @@ def version(self, code): return "1.7.1"
- def path(self, code): - return '/index.php' + def scriptpath(self, code): + return '' + + def apipath(self, code): + raise NotImplementedError( + "The lyricwiki family does not support api.php")
Modified: trunk/pywikipedia/families/mac_wikicities_family.py =================================================================== --- trunk/pywikipedia/families/mac_wikicities_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/mac_wikicities_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -1,20 +1,21 @@ # -*- coding: utf-8 -*- import family, config - + class Family(family.Family): def __init__(self): family.Family.__init__(self) - self.name = 'mac_wikicities' - + self.name = 'mac.wikia' + self.langs = { - 'de':'de.mac.wikicities.com', - 'en':'en.mac.wikicities.com', - 'es':'es.mac.wikicities.com', - 'fr':'fr.mac.wikicities.com', - 'it':'it.mac.wikicities.com', - 'zh':'zh.mac.wikicities.com', + 'de':'de.mac.wikia.com', + 'en':'mac.wikia.com', + 'es':'es.mac.wikia.com', + 'fr':'fr.mac.wikia.com', + 'id':'id.mac.wikia.com', + 'it':'it.mac.wikia.com', + 'zh':'zh.mac.wikia.com', } - + # Most namespaces are inherited from family.Family. self.namespaces[4] = { '_default': [u'WikiMac', self.namespaces[4]['_default']], @@ -23,16 +24,17 @@ '_default': [u'WikiMac talk', self.namespaces[5]['_default']], 'de': u'WikiMac Diskussion', } - + # A few selected big languages for things that we do not want to loop over # all languages. This is only needed by the titletranslate.py module, so # if you carefully avoid the options, you could get away without these # for another wikimedia family. - + self.languages_by_size = ['en','de']
def version(self, code): return "1.10alpha" - - def path(self, code): - return '/index.php' + + def scriptpath(self, code): + return '' +
Modified: trunk/pywikipedia/families/mdc_family.py =================================================================== --- trunk/pywikipedia/families/mdc_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/mdc_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -27,6 +27,7 @@ self.namespaces[4] = { '_default': u'MDC', } + self.namespaces[5] = { '_default': u'MDC talk', 'ca': u'MDC Discussió', @@ -45,8 +46,12 @@ def hostname(self,code): return 'developer.mozilla.org'
- def path(self, code): - return '/'+code+'/docs/index.php' + def scriptpath(self, code): + return '/'+code+'/docs'
+ def apipath(self, code): + raise NotImplementedError( + "The mdc family does not support api.php") + def version(self, code): - return "1.5" + return "1.9.3"
Deleted: trunk/pywikipedia/families/mediapedia_family.py =================================================================== --- trunk/pywikipedia/families/mediapedia_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/mediapedia_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -import family - -# MediaPedia is a wiki used by the MIT Media Lab. - -class Family(family.Family): - def __init__(self): - family.Family.__init__(self) - self.name = 'mediapedia' - - self.langs = { - 'en':'pedia.media.mit.edu', - } - - # Most namespaces are inherited from family.Family. - - self.namespaces[4] = { - '_default': [u'MLPedia', self.namespaces[4]['_default']], - } - self.namespaces[5] = { - '_default': [u'MLPedia talk', self.namespaces[5]['_default']], - } - - def version(self, code): - return "1.6.5" - - def path(self, code): - return '/wiki'
Modified: trunk/pywikipedia/families/memoryalpha_family.py =================================================================== --- trunk/pywikipedia/families/memoryalpha_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/memoryalpha_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- import family - + # The Memory Alpha family, a set of StarTrek wikis.
class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = 'memoryalpha' - + self.langs = { 'de': None, 'en': None, @@ -22,9 +22,9 @@ # Override defaults self.namespaces[2]['pl'] = u'Użytkownik' self.namespaces[3]['pl'] = u'Dyskusja użytkownika' - + # Most namespaces are inherited from family.Family. - + self.namespaces[4] = { '_default': u'Memory Alpha', } @@ -45,20 +45,20 @@ '_default': u'Forum talk', 'de': u'Forum Diskussion', } - + # A few selected big languages for things that we do not want to loop over # all languages. This is only needed by the titletranslate.py module, so # if you carefully avoid the options, you could get away without these # for another wiki family. self.languages_by_size = ['en', 'de', 'es', 'nl', 'sv', 'fr', 'eo', 'pl'] - + alphabetic = ['de', 'en', 'es', 'eo', 'fr', 'nl', 'pl', 'sv']
def hostname(self,code): return 'www.memory-alpha.org'
- def path(self, code): - return '/%s/index.php' % code + def scriptpath(self, code): + return '/%s' % code
def version(self, code): - return "1.10alpha" + return "1.12alpha"
Modified: trunk/pywikipedia/families/mozilla_family.py =================================================================== --- trunk/pywikipedia/families/mozilla_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/mozilla_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -26,7 +26,11 @@ return r'<li\s*><a href=".*?title=.*?&action=history".*?>.*?</a></li>'
def version(self, code): - return "1.6.8" + return "1.10.2"
- def path(self, code): - return '/index.php' + def scriptpath(self, code): + return '' + + def apipath(self, code): + raise NotImplementedError( + "The mozilla family does not support api.php")
Modified: trunk/pywikipedia/families/openttd_family.py =================================================================== --- trunk/pywikipedia/families/openttd_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/openttd_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -7,14 +7,14 @@ # The project wiki of OpenTTD, an open source game (Transport Tycoon Deluxe clone).
class Family(family.Family): - + def __init__(self): family.Family.__init__(self) self.name = 'openttd' self.langs = { 'en': 'wiki.openttd.org', } - + self.namespaces[4] = { '_default': [u'OpenTTD', self.namespaces[4]['_default']], } @@ -28,12 +28,12 @@ '_default': u'Development', }
- def path(self, code): - return '/index.php' + def scriptpath(self, code): + return ''
- def querypath(self, code): - return '/query.php' - def version(self, code): return "1.9.1"
+ def apipath(self, code): + raise NotImplementedError( + "The openttd family does not support api.php")
Modified: trunk/pywikipedia/families/pakanto_family.py =================================================================== --- trunk/pywikipedia/families/pakanto_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/pakanto_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -7,14 +7,13 @@ # The Pakanto wiki, a project to maintain Linux package descriptions
class Family(family.Family): - + def __init__(self): family.Family.__init__(self) self.name = 'pakanto' self.langs = { - 'pakanto': 'pakanto.org', + 'pakanto': 'www.pakanto.org', } - self.namespaces[4] = { '_default': [u'Pakanto', self.namespaces[4]['_default']], } @@ -22,12 +21,9 @@ '_default': [u'Pakanto talk', self.namespaces[5]['_default']], }
- def path(self, code): - return '/index.php' + def scriptpath(self, code): + return ''
- def querypath(self, code): - return '/query.php' - def version(self, code): return "1.11alpha"
Modified: trunk/pywikipedia/families/southernapproach_family.py =================================================================== --- trunk/pywikipedia/families/southernapproach_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/southernapproach_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -7,13 +7,10 @@ def __init__(self): family.Family.__init__(self) self.name = 'southernapproach' - self.langs = { 'de':'www.zrhwiki.ch', } - # Most namespaces are inherited from family.Family. - self.namespaces[4] = { '_default': [u'ZRHwiki', self.namespaces[4]['_default']], } @@ -22,7 +19,4 @@ }
def version(self, code): - return "1.10" - - def path(self, code): - return '/wiki/index.php' + return "1.12alpha"
Modified: trunk/pywikipedia/families/supertux_family.py =================================================================== --- trunk/pywikipedia/families/supertux_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/supertux_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -7,14 +7,13 @@ # The project wiki of SuperTux, an open source arcade game.
class Family(family.Family): - + def __init__(self): family.Family.__init__(self) self.name = 'supertux' self.langs = { 'en': 'supertux.lethargik.org', } - self.namespaces[4] = { '_default': [u'SuperTux', self.namespaces[4]['_default']], } @@ -22,8 +21,8 @@ '_default': [u'SuperTux talk', self.namespaces[5]['_default']], }
- def path(self, code): - return '/wiki/index.php' + def scriptpath(self, code): + return '/wiki'
def version(self, code): - return "1.10" + return "1.11.1"
Modified: trunk/pywikipedia/families/uncyclopedia_family.py =================================================================== --- trunk/pywikipedia/families/uncyclopedia_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/uncyclopedia_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -2,34 +2,54 @@ import family
# The Uncyclopaedia family, a satirical set of encyclopaedia wikis. -# +# + class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = 'uncyclopedia'
self.langs = { - 'ar': 'beidipedia.wikia.com', - 'ca': 'valenciclopedia.wikia.com', - 'da': 'da.uncyclopedia.wikia.com', - 'de': 'de.uncyclopedia.wikia.com', - 'el': 'anegkyklopaideia.wikia.com', - 'en': 'uncyclopedia.org', - 'es': 'inciclopedia.wikia.com', - 'fr': 'desencyclopedie.com', - 'he': 'eincyclopedia.wikia.com', - 'hu': 'hu.uncyclopedia.info', - 'it': 'nonciclopedia.wikia.com', - 'ja': 'ja.uncyclopedia.info', - 'la': 'uncapaedia.wikia.com', - 'no': 'ikkepedia.net', - 'pl': 'nonsensopedia.wikia.com', - 'pt': 'pt.uncyclopedia.info', - 'ru': 'absurdopedia.wikia.com', - 'sv': 'psyklopedin.hehu.se', - 'zh': 'zh.uncyclopedia.wikia.com', - 'zh-tw': 'zh.uncyclopedia.info', - } + "ar": "beidipedia.wikia.com", + "ast": "nunyepedia.wikia.com", + "ca": "valenciclopedia.wikia.com", + "cs": "necyklopedie.wikia.com", + "da": "spademanns.wikia.com", + "de": "de.uncyclopedia.org", + "el": "frikipaideia.wikia.com", + "en": "uncyclopedia.org", + "eo": "neciklopedio.wikia.com", + "es": "inciclopedia.wikia.com", + "fa": "fa.uncyc.org", + "fi": "hiki.pedia.ws", + "fr": "desencyclopedie.wikia.com", + "he": "eincyclopedia.wikia.com", + "hr": "hr.neciklopedija.org", + "hu": "unciklopedia.org", + "id": "tolololpedia.wikia.com", + "it": "nonciclopedia.wikia.com", + "ja": "ja.uncyclopedia.info", + "ko": "ko.uncyclopedia.info", + "la": "uncapaedia.wikia.com", + "lt": "nesamopedija.wikia.com", + "lv": "lv.neciklopedija.org", + "nl": "oncyclopedia.net", + "nn": "ikkepedia.org", + "no": "ikkepedia.wikia.com", + "pl": "nonsensopedia.wikia.com", + "pt": "desciclo.pedia.ws", + "ru": "absurdopedia.wikia.com", + "sk": "necyklopedia.wikia.com", + "sl": "butalo.pedija.org", + "sr": "sr.neciklopedija.org", + "sv": "psyklopedin.org", + "th": "th.uncyclopedia.info", + "tr": "yansiklopedi.org", + "yi": "keinziklopedie.wikia.com", + "zh": "zh.uncyclopedia.wikia.com", + "zh-hk": "zh.uncyclopedia.info", + "zh-tw": "zh.uncyclopedia.info", + }
# Most namespaces are inherited from family.Family. self.namespaces[1] = { @@ -247,24 +267,8 @@ def hostname(self,code): return self.langs[code]
- def path(self, code): - if code=='ar': - return '/index.php' - if code=='en': - return '/index.php' - if code=='fi': - return '/hikipedia/index.php' - if code=='hu': - return '/index.php' - if code=='ja': - return '/index.php' - if code=='no': - return '/index.php' - if code=='sv': - return '/w/index.php' - if code=='zh-tw': - return '/index.php' - return '/wiki/index.php' + def scriptpath(self, code): + return ''
def version(self, code): - return "1.9.3" + return "1.12alpha"
Modified: trunk/pywikipedia/families/wikibond_family.py =================================================================== --- trunk/pywikipedia/families/wikibond_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/wikibond_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -2,7 +2,8 @@
import family
-# I added this becouse someone asked me to. The url op the wiki: nl.wikibond.org +# I added this becouse someone asked me to. +# The url op the wiki: nl.wikibond.org
class Family(family.Family):
@@ -19,8 +20,12 @@ 'nl': [u'Overleg WikiBond'], }
- def path(self, code): - return '/wikibond/index.php' + def scriptpath(self, code): + return '/wikibond'
def version(self, code): return "1.11alpha" + + def apipath(self, code): + raise NotImplementedError( + "The wikibond family does not support api.php")
Modified: trunk/pywikipedia/families/wikitech_family.py =================================================================== --- trunk/pywikipedia/families/wikitech_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/wikitech_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -24,5 +24,5 @@ def version(self, code): return "1.12alpha"
- def path(self, code): - return '/index.php' + def scriptpath(self, code): + return ''
Modified: trunk/pywikipedia/families/wikitravel_family.py =================================================================== --- trunk/pywikipedia/families/wikitravel_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/wikitravel_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -49,11 +49,15 @@ def hostname(self,code): return 'wikitravel.org'
- def path(self, code): - return '/wiki/%s/index.php' % code + def scriptpath(self, code): + return '/wiki/%s' % code
+ def apipath(self, code): + raise NotImplementedError( + "The wikitravel family does not support api.php") + def shared_image_repository(self, code): return ('wikitravel_shared', 'wikitravel_shared')
def version(self, code): - return "1.9.3" + return "1.10.1"
Modified: trunk/pywikipedia/families/wikitravel_shared_family.py =================================================================== --- trunk/pywikipedia/families/wikitravel_shared_family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/families/wikitravel_shared_family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -20,7 +20,6 @@ self.namespaces[5] = { '_default': [u'Wikitravel Shared talk', self.namespaces[5]['_default']], } - self.namespaces[200] = { '_default': [u'Tech', self.namespaces[5]['_default']], } @@ -30,12 +29,16 @@
self.interwiki_forward = 'wikitravel'
- def path(self, code): - return '/wiki/shared/index.php' + def scriptpath(self, code): + return '/wiki/shared'
+ def apipath(self, code): + raise NotImplementedError( + "The wikitravel_shared family does not support api.php") + def shared_image_repository(self, code): return ('wikitravel_shared', 'wikitravel_shared')
def version(self, code): - return "1.11alpha" + return "1.10.1"
Modified: trunk/pywikipedia/family.py =================================================================== --- trunk/pywikipedia/family.py 2008-02-21 14:03:19 UTC (rev 5065) +++ trunk/pywikipedia/family.py 2008-02-21 19:42:30 UTC (rev 5066) @@ -1989,8 +1989,6 @@ # letters that can follow a wikilink and are regarded as part of this link # This depends on the linktrail setting in LanguageXx.php and on # [[MediaWiki:Linktrail]]. - # See http://meta.wikipedia.org/wiki/Locales_for_the_Wikipedia_Software - # to find out the setting for your wiki. # Note: this is a regular expression. self.linktrails = { '_default': u'[a-z]*', @@ -2618,7 +2616,9 @@ elif fallback: return self.disambiguationTemplates[fallback] else: - raise KeyError('ERROR: title for disambig template in language %s unknown' % code) + raise KeyError( + 'ERROR: title for disambig template in language %s unknown' + % code)
# Returns the title of the special namespace in language 'code', taken from # dictionary above. @@ -2739,14 +2739,28 @@ def hostname(self, code): return self.langs[code]
+ def scriptpath(self, code): + """The prefix used to locate scripts on this wiki. + + This is the value displayed when you enter {{SCRIPTPATH}} on a + wiki page (often displayed at [[Help:Variables]] if the wiki has + copied the master help page correctly). + + The default value is the one used on Wikimedia Foundation wikis, + but needs to be overridden in the family file for any wiki that + uses a different value. + + """ + return '/w' + def path(self, code): - return '/w/index.php' + return '%s/index.php' % self.scriptpath(code)
def querypath(self, code): - return '/w/query.php' + return '%s/query.php' % self.scriptpath(code)
def apipath(self, code): - return '/w/api.php' + return '%s/api.php' % self.scriptpath(code)
def nicepath(self, code): return '/wiki/'
pywikipedia-l@lists.wikimedia.org