http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10082
Revision: 10082 Author: binbot Date: 2012-04-04 15:21:23 +0000 (Wed, 04 Apr 2012) Log Message: ----------- With -nosub will not process subpages. Useful in template or portal namespace.
Modified Paths: -------------- trunk/pywikipedia/ndashredir.py
Modified: trunk/pywikipedia/ndashredir.py =================================================================== --- trunk/pywikipedia/ndashredir.py 2012-04-04 12:44:52 UTC (rev 10081) +++ trunk/pywikipedia/ndashredir.py 2012-04-04 15:21:23 UTC (rev 10082) @@ -16,6 +16,9 @@ -namespace Works in the given namespace (only one at a time). Parameter -ns may be given as "-ns:<number>" or "-namespace:<number>". Defaults to 0 (main namespace). +-nosub Will not process subpages. Useful in template or portal + namespace. (Not recommended for main namespace that has no + real subpages.) -save Saves the title of existing hyphenated articles whose content is _other_ than a redirect to the corresponding article with n dash or m dash in the title and thus may need manual @@ -56,6 +59,8 @@ ns = pywikibot.input(u'Which namespace should we process?') elif arg.startswith('-ns:') or arg.startswith('-namespace:'): ns = arg[arg.find(':')+1:] + elif arg == '-nosub': + regex = ur'[^/]*[–—][^/]*$' elif arg == '-save': filename = pywikibot.input('Please enter the filename:') elif arg.startswith('-save:'):