http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10184
Revision: 10184 Author: xqt Date: 2012-05-05 16:39:51 +0000 (Sat, 05 May 2012) Log Message: ----------- update property decorator from rewrite r8238, __call__() method for backwards compatibility
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2012-05-05 09:45:27 UTC (rev 10183) +++ trunk/pywikipedia/wikipedia.py 2012-05-05 16:39:51 UTC (rev 10184) @@ -427,6 +427,7 @@ ) raise
+ @property def site(self): """Return the Site object for the wiki on which this Page resides.""" return self._site @@ -4986,6 +4987,17 @@ if not language[0].upper() + language[1:] in self.namespaces(): self._validlanguages.append(language)
+ def __call__(self): + """Since the Page.site() method has a property decorator, return the + site object for backwards-compatibility if Page.site() call is still + used instead of Page.site as recommended. + + """ +## # DEPRECATED warning. Should be uncommented if scripts are actualized +## pywikibot.output('Page.site() method is DEPRECATED, ' +## 'use Page.site instead.') + return self + @property def family(self): """The Family object for this Site's wiki family."""
pywikipedia-svn@lists.wikimedia.org