Revision: 4713 Author: rotem Date: 2007-12-15 13:06:21 +0000 (Sat, 15 Dec 2007)
Log Message: ----------- Raise an exception when creating an ImagePage that is not in the image namespace.
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2007-12-15 12:50:08 UTC (rev 4712) +++ trunk/pywikipedia/wikipedia.py 2007-12-15 13:06:21 UTC (rev 4713) @@ -2220,8 +2220,9 @@
""" def __init__(self, site, title, insite = None): - # TODO: raise an exception if title is not in Image: namespace Page.__init__(self, site, title, insite, defaultNamespace=6) + if self.namespace() != 6: + raise ValueError(u'BUG: %s is not in the image namespace!' % title) self._imagePageHtml = None
def getImagePageHtml(self):
pywikipedia-l@lists.wikimedia.org