User-fixes.py

From Meta, a Wikimedia project coordination wiki

Jump to: navigation, search
Crystal Clear action run.png
Generate user-fixes.py by running generate_user_files.py.
Subversion repository of wikimedia has the file:

[edit] user-fixes.py

Add some custom fixes in this user file. Generate it with generate_user_files.py if it doesn't exist.

[edit] Example

# -*- coding: utf-8  -*-

#
# This is only an example. Don't use it.
#

fixes['example'] = {
    'regex': True,
    'msg': {
        '_default':u'no summary specified',
    },
    'replacements': [
        (ur'\bword\b', u'two words'),
    ]
}
 
#
# Add wikilinks. 
# This fix is used with command:
# python replace.py -fix:wikilinks [-nocase] -subcat (or -xml)

fixes['wikilinks'] = {
	'regex': True,
	'msg': { '_default':u'adding wikilinks', },
	'replacements': [
		(r'(?i)\b(barrettes)', r"[[\1]]"), # barrettes will be changed to [[barrettes]]
		(r'(?i)\b(barrette)', r"[[\1]]"),		
	]
}


See also: Using the python wikipediabot