Replacetext.py

From MythTV Official Wiki
Revision as of 03:50, 22 March 2007 by T0ny (talk | contribs)

Jump to: navigation, search

Important.png Note: The correct title of this article is replacetext.py. It appears incorrectly here due to technical restrictions.


replacetext.py is a pywikipedia script used to scan the entire site for a particular string, and substitute it with another. It intelligently only looks at real pages, not redirects, categories, or images. It only updates a page if there is a substitution.

Source code

Template:Box File

Usage

To run the script, it needs two arguments. (Use quotation marks to escape the shell).

% python replacetext.py "old text" "new text"

It will check every article, and if it contains "old text", it will replace it with "new text".