http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11747
Revision: 11747 Author: amir Date: 2013-07-13 08:11:29 +0000 (Sat, 13 Jul 2013) Log Message: ----------- fixing bug #1642
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2013-07-12 20:22:37 UTC (rev 11746) +++ trunk/pywikipedia/wikipedia.py 2013-07-13 08:11:29 UTC (rev 11747) @@ -4626,7 +4626,13 @@ except AttributeError: raise SectionError # Page has no section by this name self._contents = json.loads(pagetext) - self._title = self._contents['entity'].title() + if self._contents['entity'][0]=='item': + self._title="Q" + elif self._contents['entity'][0]=='property': + self._title="P" + else: + raise RuntimeError("unknown type: %s call User:Ladsgroup to fix this" % self._contents['entity'][0]) + self._title = self._title+str(self._contents['entity'][1]) return self._contents
@deprecate_arg("get", None)