http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11366
Revision: 11366 Author: xqt Date: 2013-04-08 21:38:06 +0000 (Mon, 08 Apr 2013) Log Message: ----------- ignore no named sort of templates, update from trunk r11364
Modified Paths: -------------- branches/rewrite/pywikibot/textlib.py
Modified: branches/rewrite/pywikibot/textlib.py =================================================================== --- branches/rewrite/pywikibot/textlib.py 2013-04-08 21:22:43 UTC (rev 11365) +++ branches/rewrite/pywikibot/textlib.py 2013-04-08 21:38:06 UTC (rev 11366) @@ -147,6 +147,7 @@ item = m.group() text = text.replace(item, '%s%d%s' % (marker1, count, marker1))
+ # Make sure stored templates don't contain markers for m2 in Rmarker1.finditer(item): item = item.replace(m2.group(), inside[int(m2.group(1))]) for m2 in Rmarker2.finditer(item): @@ -944,7 +945,7 @@ continue
# {{#if: }} - if name.startswith('#'): + if not name or name.startswith('#'): continue
## TODO: merged from wikipedia.py - implement the following
pywikipedia-svn@lists.wikimedia.org