jenkins-bot has submitted this change and it was merged.
Change subject: [bugfix] reset the page.text content ......................................................................
[bugfix] reset the page.text content
- content retrieved from generator is saved in the page content yielded to the treat_page method. This content must be saved to a local variable and the page.text must be reseted to be updated from live wiki page.
Bug: T147766 Change-Id: I68fe4d61329b8827f3029d0ec7e184aa1a67446b --- M scripts/pagefromfile.py 1 file changed, 4 insertions(+), 1 deletion(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/pagefromfile.py b/scripts/pagefromfile.py index 23e5743..390f26f 100755 --- a/scripts/pagefromfile.py +++ b/scripts/pagefromfile.py @@ -130,7 +130,10 @@ """Upload page content.""" page = self.current_page title = page.title() + # save the content retrieved from generator contents = page.text + # delete page's text to get it from live wiki + del page.text
if self.getOption('summary'): comment = self.getOption('summary') @@ -148,7 +151,7 @@ if not self.getOption('redirect') and page.isRedirectPage(): pywikibot.output(u"Page %s is redirect, skipping!" % title) return - pagecontents = page.get(get_redirect=True) + pagecontents = page.text nocontent = self.getOption('nocontent') if nocontent and ( nocontent in pagecontents or
pywikibot-commits@lists.wikimedia.org