http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10297
Revision: 10297 Author: xqt Date: 2012-06-05 12:41:01 +0000 (Tue, 05 Jun 2012) Log Message: ----------- enable default sort key for Category.aslink(), bugfix for r5088
Modified Paths: -------------- branches/rewrite/pywikibot/page.py
Modified: branches/rewrite/pywikibot/page.py =================================================================== --- branches/rewrite/pywikibot/page.py 2012-06-04 17:02:54 UTC (rev 10296) +++ branches/rewrite/pywikibot/page.py 2012-06-05 12:41:01 UTC (rev 10297) @@ -1573,7 +1573,7 @@ @deprecate_arg("forceInterwiki", None) @deprecate_arg("textlink", None) @deprecate_arg("noInterwiki", None) - def aslink(self, sortKey=u''): + def aslink(self, sortKey=None): """Return a link to place a page in this Category.
Use this only to generate a "true" category link, not for interwikis @@ -1584,9 +1584,10 @@ @type sortKey: (optional) unicode
""" - if sortKey: + key = sortKey or self.sortKey + if key: titleWithSortKey = '%s|%s' % (self.title(withSection=False), - self.sortKey) + key) else: titleWithSortKey = self.title(withSection=False) return '[[%s]]' % titleWithSortKey
pywikipedia-svn@lists.wikimedia.org