Revision: 4590
Author: rotem
Date: 2007-11-25 12:47:53 +0000 (Sun, 25 Nov 2007)
Log Message:
-----------
(bug 1837716) Fixing a crash with comsmetic_changes.py: skip namespace if default namespace is empty (this should be the case for all custom namespaces, as they are not defined by default). Adding empty _default entries for custom namespaces of Wikibooks, to avoid problems there.
Modified Paths:
--------------
trunk/pywikipedia/cosmetic_changes.py
trunk/pywikipedia/families/wikibooks_family.py
Modified: trunk/pywikipedia/cosmetic_changes.py
===================================================================
--- trunk/pywikipedia/cosmetic_changes.py 2007-11-25 12:24:46 UTC (rev 4589)
+++ trunk/pywikipedia/cosmetic_changes.py 2007-11-25 12:47:53 UTC (rev 4590)
@@ -145,8 +145,8 @@
thisNs = family.namespace(self.site.lang, nsNumber)
defaultNs = family.namespace('_default', nsNumber)
- # skip main (article) namespace
- if thisNs:
+ # skip main (article) namespace, and namespaces with no default translation
+ if thisNs and defaultNs:
wrongNamespaces = []
if defaultNs != thisNs:
wrongNamespaces.append(defaultNs)
Modified: trunk/pywikipedia/families/wikibooks_family.py
===================================================================
--- trunk/pywikipedia/families/wikibooks_family.py 2007-11-25 12:24:46 UTC (rev 4589)
+++ trunk/pywikipedia/families/wikibooks_family.py 2007-11-25 12:47:53 UTC (rev 4590)
@@ -175,6 +175,7 @@
}
self.namespaces[102] = {
+ '_default': u'',
'cy': u'Silff lyfrau',
'de': u'Regal',
'en': u'Cookbook',
@@ -186,6 +187,7 @@
}
self.namespaces[103] = {
+ '_default': u'',
'cy': u'Sgwrs Silff lyfrau',
'de': u'Regal Diskussion',
'en': u'Cookbook talk',
@@ -197,38 +199,46 @@
}
self.namespaces[104] = {
+ '_default': u'',
'he': u'מדף',
'ka': u'თარო',
'nl': u'Wikijunior',
}
self.namespaces[105] = {
+ '_default': u'',
'he': u'שיחת מדף',
'ka': u'თარო განხილვა',
'nl': u'Overleg Wikijunior',
}
self.namespaces[108] = {
+ '_default': u'',
'en': u'Transwiki',
}
self.namespaces[109] = {
+ '_default': u'',
'en': u'Transwiki talk',
}
self.namespaces[110] = {
+ '_default': u'',
'en': u'Wikijunior',
}
self.namespaces[111] = {
+ '_default': u'',
'en': u'Wikijunior talk',
}
self.namespaces[112] = {
+ '_default': u'',
'en': u'Subject',
}
self.namespaces[113] = {
+ '_default': u'',
'en': u'Subject talk',
}