User:HighwindBot/ImageCategorization
From Memory Alpha, the free Star Trek reference.
[edit] Function
Adds a category link to Category:Memory Alpha images to all images that aren't categorized yet.
[edit] Code snippet
The following can be added to the fixes at fixes.py, then be called using
- replace.py -fix:imgcat -start:Image:!
ATTENTION: Make sure to only run this on pages in "Image:" namespace!
'imgcat': {
'regex': True,
'exceptions': ['Category:Memory Alpha images'],
'msg': {
'en':u'categorizing images',
},
'replacements': [
(u'\n(.*)\Z', u'\n\\1\n[[Category:Memory Alpha images]]'),
],
},