jenkins-bot has submitted this change and it was merged.
Change subject: pagefromfile.py: -start argument conflict
......................................................................
pagefromfile.py: -start argument conflict
Deprecated -start for -begin to avoid conflict with pagegenerators.py
params, if pagegenerators will be used in future.
Both parameters survive with same meaning, for backward compatibility.
Start will be replaced completely in future.
Bug: T100628
Change-Id: I84ab19e144199de7a7553b2674d10cfbf5fc0ab7
---
M scripts/pagefromfile.py
1 file changed, 11 insertions(+), 3 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/pagefromfile.py b/scripts/pagefromfile.py
index 1eda597..b1411f9 100755
--- a/scripts/pagefromfile.py
+++ b/scripts/pagefromfile.py
@@ -17,7 +17,8 @@
Specific arguments:
--start:xxx Specify the text that marks the beginning of a page
+-begin:xxx Specify the text that marks the beginning of a page
+-start:xxx (deprecated)
-end:xxx Specify the text that marks the end of a page
-file:xxx Give the filename we are getting our material from
(default: dict.txt)
@@ -54,7 +55,7 @@
"""
#
# (C) Andre Engels, 2004
-# (C) Pywikibot team, 2005-2014
+# (C) Pywikibot team, 2005-2015
#
# Distributed under the terms of the MIT license.
#
@@ -66,9 +67,11 @@
import os
import re
import codecs
+from warnings import warn
import pywikibot
from pywikibot import config, Bot, i18n
+from pywikibot.exceptions import ArgumentDeprecationWarning
class NoTitle(Exception):
@@ -278,8 +281,13 @@
notitle = False
for arg in pywikibot.handle_args(args):
- if arg.startswith("-start:"):
+ if arg.startswith('-start:'):
pageStartMarker = arg[7:]
+ warn('-start param (text that marks the beginning) of a page has been
'
+ 'deprecated in favor of begin; make sure to use the updated
param.',
+ ArgumentDeprecationWarning)
+ elif arg.startswith('-begin:'):
+ pageStartMarker = arg[len('-begin:'):]
elif arg.startswith("-end:"):
pageEndMarker = arg[5:]
elif arg.startswith("-file:"):
--
To view, visit
https://gerrit.wikimedia.org/r/214717
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I84ab19e144199de7a7553b2674d10cfbf5fc0ab7
Gerrit-PatchSet: 7
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>