http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9298
Revision: 9298 Author: xqt Date: 2011-06-14 10:37:46 +0000 (Tue, 14 Jun 2011) Log Message: ----------- stripped trailing white space, some cosmetics
Modified Paths: -------------- trunk/pywikipedia/create_categories.py
Modified: trunk/pywikipedia/create_categories.py =================================================================== --- trunk/pywikipedia/create_categories.py 2011-06-14 10:27:11 UTC (rev 9297) +++ trunk/pywikipedia/create_categories.py 2011-06-14 10:37:46 UTC (rev 9298) @@ -2,11 +2,12 @@ """ Program to batch create categories.
-The program expects a generator containing a list of page titles to be used as base. +The program expects a generator containing a list of page titles to be used as +base.
The following command line parameters are supported:
--alway (not implemented yet) Don't ask, just do the edit. +-always (not implemented yet) Don't ask, just do the edit.
-overwrite (not implemented yet).
@@ -61,8 +62,8 @@ else: #FIXME: Add overwrite option pywikibot.output(u'%s already exists, skipping' % (newpage.title(),)) -
+ def main(args): ''' Main loop. Get a generator and options. @@ -71,7 +72,7 @@ parent = u'' basename = u'' always = False - + genFactory = pagegenerators.GeneratorFactory()
for arg in pywikibot.handleArgs(): @@ -90,7 +91,7 @@ createCategory(page, parent, basename) else: pywikibot.output(u'No pages to work on') - + pywikibot.output(u'All done')
if __name__ == "__main__":
pywikipedia-svn@lists.wikimedia.org