http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9510
Revision: 9510 Author: xqt Date: 2011-09-06 16:14:36 +0000 (Tue, 06 Sep 2011) Log Message: ----------- code a bit more pythonic
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2011-09-04 19:04:59 UTC (rev 9509) +++ trunk/pywikipedia/wikipedia.py 2011-09-06 16:14:36 UTC (rev 9510) @@ -4392,7 +4392,7 @@ # TODO: why isn't this a Site method? pages = list(pages) # if pages is an iterator, we need to make it a list output(u'Getting %d pages %sfrom %s...' - % (len(pages), iif(site.has_api() and debug, u'via API ', u''), site)) + % (len(pages), u'via API ' if site.has_api() and debug else u'', site)) limit = config.special_page_limit / 4 # default is 500/4, but It might have good point for server. if len(pages) > limit: # separate export pages for bulk-retrieve @@ -4420,11 +4420,6 @@ global action action = s
-def iif(q, a, b): - """inline if""" - if q: return a - else: return b - # Default action setAction('Wikipedia python library')
pywikipedia-svn@lists.wikimedia.org