Revision: 8463 Author: xqt Date: 2010-08-26 11:58:18 +0000 (Thu, 26 Aug 2010)
Log Message: ----------- enable maintenance tools for one project only
Modified Paths: -------------- trunk/pywikipedia/maintenance/update_namespaces.py trunk/pywikipedia/maintenance/wikimedia_sites.py
Modified: trunk/pywikipedia/maintenance/update_namespaces.py =================================================================== --- trunk/pywikipedia/maintenance/update_namespaces.py 2010-08-26 11:56:59 UTC (rev 8462) +++ trunk/pywikipedia/maintenance/update_namespaces.py 2010-08-26 11:58:18 UTC (rev 8463) @@ -105,21 +105,24 @@ try: update_main_family = False update_wikimedia = False + families = ['wiktionary', 'wikiquote','wikisource', + 'wikibooks', 'wikinews', 'wikiversity','meta', 'commons', + 'mediawiki', 'species', 'incubator', 'test' + ] for arg in wikipedia.handleArgs(): if arg == '-upmain': update_main_family = True elif arg == '-wikimedia': update_wikimedia = True + elif arg in families: + families = [arg] + update_wikimedia = False + else: + families = [wikipedia.default_family]
if update_wikimedia: check_and_update( ['wikipedia'], True) - families = ['wiktionary', 'wikiquote','wikisource', - 'wikibooks', 'wikinews', 'wikiversity','meta', 'commons', - 'mediawiki', 'species', 'incubator', 'test' - ] update_main_family = False - else: - families = [ wikipedia.default_family ] check_and_update(families, update_main_family) finally: wikipedia.stopme()
Modified: trunk/pywikipedia/maintenance/wikimedia_sites.py =================================================================== --- trunk/pywikipedia/maintenance/wikimedia_sites.py 2010-08-26 11:56:59 UTC (rev 8462) +++ trunk/pywikipedia/maintenance/wikimedia_sites.py 2010-08-26 11:58:18 UTC (rev 8463) @@ -23,10 +23,11 @@ 'wikinews': 'wikinews_wiki.php', 'wikiversity':'wikiversity_wiki.php', } -families = familiesDict.keys() exceptions = ['www']
-def update_family(): +def update_family(families): + if not families: + families = familiesDict.keys() for family in families: wikipedia.output('Checking family %s:' % family)
@@ -76,6 +77,10 @@
if __name__ == '__main__': try: - update_family() + fam = [] + for arg in wikipedia.handleArgs(): + if arg in familiesDict.keys(): + fam = [arg] + update_family(fam) finally: wikipedia.stopme()
pywikipedia-svn@lists.wikimedia.org