http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9554
Revision: 9554 Author: xqt Date: 2011-09-25 18:41:52 +0000 (Sun, 25 Sep 2011) Log Message: ----------- -subst option is always needed for substituting a template
Modified Paths: -------------- trunk/pywikipedia/template.py
Modified: trunk/pywikipedia/template.py =================================================================== --- trunk/pywikipedia/template.py 2011-09-25 17:24:13 UTC (rev 9553) +++ trunk/pywikipedia/template.py 2011-09-25 18:41:52 UTC (rev 9554) @@ -64,18 +64,14 @@ If you have a template called [[Template:test]] and want to substitute it only on pages in the User: and User talk: namespaces, do:
- python template.py test -namespace:2 -namespace:3 + python template.py test -subst -namespace:2 -namespace:3
-Note that, on the English Wikipedia, User: is namespace 2 and User talk: is -namespace 3. This may differ on other projects so make sure to find out the -appropriate namespace numbers.
- This next example substitutes the template lived with a supplied edit summary. It only performs substitutions in main article namespace and doesn't prompt to start replacing. Note that -putthrottle: is a global pywikipedia parameter.
- python template.py -putthrottle:30 -namespace:0 lived -always + python template.py -putthrottle:30 -namespace:0 lived -subst -always -summary:"ROBOT: Substituting {{lived}}, see [[WP:SUBST]]."
pywikipedia-svn@lists.wikimedia.org