jenkins-bot has submitted this change and it was merged.

Change subject: [FEAT] ParamInfo: Read mustbeposted from help
......................................................................


[FEAT] ParamInfo: Read mustbeposted from help

When it reads the ParamInfo data from the help text it can interpret the
help text to determine whether an action requires to be posted.

Change-Id: Ia24e5280f21973b2d386d1e8912f689a859d7b26
---
M pywikibot/data/api.py
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Ricordisamoa: Looks good to me, but someone else must approve
  XZise: Looks good to me, but someone else must approve
  Ladsgroup: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 7946767..71cc0a9 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -430,6 +430,7 @@
                 start = help_text.find(mod_begin_string)
                 assert(start)
                 start += len(mod_begin_string)
+                end = help_text.find('\n*', start)
 
                 if help_text[start + 1] == '(' and help_text[start + 4] == ')':
                     prefix = help_text[start + 2:start + 4]
@@ -490,6 +491,9 @@
                         }
 
                 self._paraminfo[path]['parameters'] = params.values()
+                if (help_text.find('\n\nThis module only accepts POST '
+                                   'requests.\n', start) < end):
+                    self._paraminfo[path]['mustbeposted'] = ''
 
         self._emulate_pageset()
 

-- 
To view, visit https://gerrit.wikimedia.org/r/199597
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia24e5280f21973b2d386d1e8912f689a859d7b26
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <commodorefabia...@gmx.de>
Gerrit-Reviewer: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhall...@arctus.nl>
Gerrit-Reviewer: Ricordisamoa <ricordisa...@openmailbox.org>
Gerrit-Reviewer: XZise <commodorefabia...@gmx.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to