XZise has uploaded a new change for review.
https://gerrit.wikimedia.org/r/182403
Change subject: [IMPROV] Site: Warn more detailed if site to old
......................................................................
[IMPROV] Site: Warn more detailed if site to old
If the site to old and the value would be valid for new versions, it's
specifically saying that the site doesn't support that value and not
that the value is invalid at all.
Change-Id: I1a00a8dbcb5a4ee94d89222543e574f14a77184e
---
M pywikibot/site.py
1 file changed, 8 insertions(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core
refs/changes/03/182403/1
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 188272a..973edaf 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -4008,14 +4008,16 @@
params['createonly'] = ""
if nocreate:
params['nocreate'] = ""
- watch_items = ["watch", "unwatch"]
- if MediaWikiVersion(self.version()) >= MediaWikiVersion("1.16"):
- watch_items += ["preferences", "nochange"]
+ watch_items = set(["watch", "unwatch", "preferences", "nochange"])
if watch in watch_items:
- if MediaWikiVersion(self.version()) >= MediaWikiVersion("1.16"):
- params['watchlist'] = watch
+ if MediaWikiVersion(self.version()) < MediaWikiVersion("1.16"):
+ if watch in ['preferences', 'nochange']:
+ pywikibot.warning(u'The watch value {0} is not supported '
+ 'by {1}'.format(watch, self))
+ else:
+ params[watch] = ""
else:
- params[watch] = ""
+ params['watchlist'] = watch
elif watch:
pywikibot.warning(
u"editpage: Invalid watch value '%(watch)s' ignored."
--
To view, visit https://gerrit.wikimedia.org/r/182403
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a00a8dbcb5a4ee94d89222543e574f14a77184e
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits