[MediaWiki-commits] [Gerrit] category: Dummy added -hist option for move action - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: category: Dummy added -hist option for move action .. category: Dummy added -hist option for move action Added boilerplate code for -hist option which is not yet ported from compat to core. Raise a not Implemented error if it the option is used. Change-Id: I2f583377b3b32127ce968ed05306cda38247d1b0 --- M scripts/category.py 1 file changed, 11 insertions(+), 2 deletions(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/category.py b/scripts/category.py index e009f86..73988e4 100755 --- a/scripts/category.py +++ b/scripts/category.py @@ -38,6 +38,8 @@ English. Options for move action: + * -hist- Creates a nice wikitable on the talk page of target category + that contains detailed page history of the source category. * -nodelete- Don't delete the old category after move Options for several actions: @@ -391,7 +393,7 @@ def __init__(self, oldCatTitle, newCatTitle, batchMode=False, editSummary='', inPlace=False, moveCatPage=True, deleteEmptySourceCat=True, titleRegex=None, - useSummaryForDeletion=True): + useSummaryForDeletion=True, withHistory=True): self.editSummary = editSummary self.oldCat = pywikibot.Category( pywikibot.Link('Category:' + oldCatTitle)) @@ -402,8 +404,11 @@ self.deleteEmptySourceCat = deleteEmptySourceCat self.titleRegex = titleRegex self.useSummaryForDeletion = useSummaryForDeletion +self.withHistory = withHistory def run(self): +if self.withHistory: +raise NotImplementedError(History printing is not yet enabled.) site = pywikibot.getSite() newCat = pywikibot.Category( pywikibot.Link('Category:' + self.newCatTitle)) @@ -873,6 +878,7 @@ recurse = False titleRegex = None pagesonly = False +withHistory = True # This factory is responsible for processing command line arguments # that are also used by other scripts and that determine on which pages @@ -943,6 +949,8 @@ create_pages = True elif arg == '-redirect': follow_redirects = True +elif arg == '-hist': +withHistory = True else: genFactory.handleArg(arg) pywikibot.Site().login() @@ -976,7 +984,8 @@ bot = CategoryMoveRobot(oldCatTitle, newCatTitle, batchMode, editSummary, inPlace, deleteEmptySourceCat=deleteEmptySourceCat, -titleRegex=titleRegex) +titleRegex=titleRegex, +withHistory=withHistory) bot.run() elif action == 'tidy': catTitle = pywikibot.input(u'Which category do you want to tidy up?') -- To view, visit https://gerrit.wikimedia.org/r/104813 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2f583377b3b32127ce968ed05306cda38247d1b0 Gerrit-PatchSet: 2 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Pyfisch pyfi...@gmail.com Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: Pyfisch pyfi...@gmail.com Gerrit-Reviewer: Xqt i...@gno.de Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] category: Dummy added -hist option for move action - change (pywikibot/core)
Pyfisch has uploaded a new change for review. https://gerrit.wikimedia.org/r/104813 Change subject: category: Dummy added -hist option for move action .. category: Dummy added -hist option for move action Added boilerplate code for -hist option which is not yet ported from compat to core. Raise a not Implemented error if it the option is used. Change-Id: I2f583377b3b32127ce968ed05306cda38247d1b0 --- M scripts/category.py 1 file changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/13/104813/1 diff --git a/scripts/category.py b/scripts/category.py index e009f86..5827639 100755 --- a/scripts/category.py +++ b/scripts/category.py @@ -38,6 +38,8 @@ English. Options for move action: + * -hist- Creates a nice wikitable on the talk page of target category + that contains detailed page history of the source category. * -nodelete- Don't delete the old category after move Options for several actions: @@ -391,7 +393,7 @@ def __init__(self, oldCatTitle, newCatTitle, batchMode=False, editSummary='', inPlace=False, moveCatPage=True, deleteEmptySourceCat=True, titleRegex=None, - useSummaryForDeletion=True): + useSummaryForDeletion=True, withHistory=True): self.editSummary = editSummary self.oldCat = pywikibot.Category( pywikibot.Link('Category:' + oldCatTitle)) @@ -402,8 +404,11 @@ self.deleteEmptySourceCat = deleteEmptySourceCat self.titleRegex = titleRegex self.useSummaryForDeletion = useSummaryForDeletion +self.withHistory = withHistory def run(self): +if self.withHistory: +raise NotImplentedError(History printing is not yet enabled.) site = pywikibot.getSite() newCat = pywikibot.Category( pywikibot.Link('Category:' + self.newCatTitle)) @@ -873,6 +878,7 @@ recurse = False titleRegex = None pagesonly = False +withHistory = True # This factory is responsible for processing command line arguments # that are also used by other scripts and that determine on which pages @@ -943,6 +949,8 @@ create_pages = True elif arg == '-redirect': follow_redirects = True +elif arg == '-hist': +withHistory = True else: genFactory.handleArg(arg) pywikibot.Site().login() @@ -976,7 +984,8 @@ bot = CategoryMoveRobot(oldCatTitle, newCatTitle, batchMode, editSummary, inPlace, deleteEmptySourceCat=deleteEmptySourceCat, -titleRegex=titleRegex) +titleRegex=titleRegex, +withHistory=withHistory) bot.run() elif action == 'tidy': catTitle = pywikibot.input(u'Which category do you want to tidy up?') -- To view, visit https://gerrit.wikimedia.org/r/104813 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2f583377b3b32127ce968ed05306cda38247d1b0 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Pyfisch pyfi...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits