jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/341321 )
Change subject: [bugfix] long must be global
......................................................................
[bugfix] long must be global
Bug: T159700
Change-Id: I3817ec85830569b59a39e3a7710846d34654f16d
---
M tests/site_tests.py
1 file changed, 4 insertions(+), 5 deletions(-)
Approvals:
Dalba: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py
index f784dbc..c4f1675 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Tests for the site module."""
#
-# (C) Pywikibot team, 2008-2016
+# (C) Pywikibot team, 2008-2017
#
# Distributed under the terms of the MIT license.
#
@@ -46,6 +46,9 @@
)
from tests.basepage_tests import BasePageLoadRevisionsCachingTestBase
from tests.utils import allowed_failure, allowed_failure_if, entered_loop
+
+if not PY2:
+ long = int # Must be global: T159700
class TokenTestBase(TestCaseBase):
@@ -1162,10 +1165,6 @@
def test_logpages(self):
"""Test the deprecated site.logpages() method."""
- # pyflakes fix for Python 3
- if not PY2:
- long = int
-
le = list(self.site.logpages(number=10))
self.assertOneDeprecation()
self.assertLessEqual(len(le), 10)
--
To view, visit https://gerrit.wikimedia.org/r/341321
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3817ec85830569b59a39e3a7710846d34654f16d
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/339905 )
Change subject: wikisourcetext.py: remove misleading -force and -showdiff
......................................................................
wikisourcetext.py: remove misleading -force and -showdiff
Remove -force and -showdiff.
It is not possible to preload text if a page is already existing.
The latest text is loaded anyhow, so when trying to override, nothing
will happen.
Change-Id: Ia93c945a57c11bf7a0e99284629461d357b99c66
---
M scripts/wikisourcetext.py
1 file changed, 7 insertions(+), 13 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/scripts/wikisourcetext.py b/scripts/wikisourcetext.py
index 2dd0e45..de5f154 100644
--- a/scripts/wikisourcetext.py
+++ b/scripts/wikisourcetext.py
@@ -22,19 +22,14 @@
A -> just page A
-B -> pages 1 until B
- -showdiff show difference before old and new text before saving.
-
-summary: custom edit summary.
Use quotes if edit summary contains spaces.
-
- -force overwrites existing text
- optional, default False
-always don't bother asking to confirm any of the changes.
"""
#
-# (C) Pywikibot team, 2016
+# (C) Pywikibot team, 2016-2017
#
# Distributed under the terms of the MIT license.
#
@@ -50,6 +45,7 @@
from pywikibot.bot import SingleSiteBot
from pywikibot.proofreadpage import IndexPage
+from pywikibot.tools import issue_deprecation_warning
class UploadTextBot(SingleSiteBot):
@@ -58,7 +54,7 @@
A bot that uploads text-layer to Page:namespace.
Text is fetched via preload as on Wikisource wikis, text can be preloaded
- even if a page does not exist, if an Index page is present.
+ only if a page does not exist, if an Index page is present.
Works only on sites with Proofread Page extension installed.
"""
@@ -71,9 +67,7 @@
@type generator: generator
"""
self.availableOptions.update({
- 'force': False,
- 'showdiff': False,
- 'summary': 'Uploading text'
+ 'summary': 'Bot: uploading text'
})
super(UploadTextBot, self).__init__(**kwargs)
self.generator = generator
@@ -90,7 +84,7 @@
new_text = page.text
summary = self.getOption('summary')
- if page.exists() and not self.getOption('force'):
+ if page.exists():
pywikibot.output('Page %s already exists, not adding!' % page)
else:
self.userPut(page, old_text, new_text,
@@ -120,11 +114,11 @@
elif arg == '-pages':
pages = value
elif arg == '-showdiff':
- options['showdiff'] = True
+ issue_deprecation_warning('The usage of -showdiff option', None, 0)
elif arg == '-summary':
options['summary'] = value
elif arg == '-force':
- options['force'] = True
+ issue_deprecation_warning('The usage of -force option', None, 0)
elif arg == '-always':
options['always'] = True
else:
--
To view, visit https://gerrit.wikimedia.org/r/339905
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia93c945a57c11bf7a0e99284629461d357b99c66
Gerrit-PatchSet: 3
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: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>