jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/670801 )
Change subject: Removed relevant options from main function & doc string of login.py
......................................................................
Removed relevant options from main function & doc string of login.py
Bug: T108848
Change-Id: I0206dc544aa00a3f8673338ae5f481557a133718
---
M scripts/login.py
1 file changed, 2 insertions(+), 35 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/login.py b/scripts/login.py
index a6409f6..3c4ff4d 100755
--- a/scripts/login.py
+++ b/scripts/login.py
@@ -20,23 +20,9 @@
all sites, or with -family and -lang to log out of a specific
site.
- -force Ignores if the user is already logged in, and tries to log in.
-
- -pass Useful in combination with -all when you have accounts for
- several sites and use the same password for all of them.
- Asks you for the password, then logs in on all given sites.
-
- -pass:XXXX Uses XXXX as password. Be careful if you use this
- parameter because your password will be shown on your
- screen, and will probably be saved in your command line
- history. This is NOT RECOMMENDED for use on computers
- where others have either physical or remote access.
- Use -pass instead.
-
-oauth Generate OAuth authentication information.
NOTE: Need to copy OAuth tokens to your user-config.py
- manually. -logout, -pass, -force and -pass:XXXX are not
- compatible with -oauth.
+ manually. -logout is not compatible with -oauth.
-autocreate Auto-create an account using unified login when necessary.
Note: the global account must exist already before using this.
@@ -57,8 +43,6 @@
#
# Distributed under the terms of the MIT license.
#
-from os.path import join
-
import pywikibot
from pywikibot.backports import Tuple
@@ -110,27 +94,14 @@
@param args: command line arguments
@type args: str
"""
- password = None
logall = False
logout = False
oauth = False
autocreate = False
unknown_args = []
for arg in pywikibot.handle_args(args):
- if arg.startswith('-pass'):
- if len(arg) == 5:
- password = pywikibot.input(
- 'Password for all accounts (no characters will be shown):',
- password=True)
- else:
- password = arg[6:]
- elif arg == '-all':
+ if arg == '-all':
logall = True
- elif arg == '-force':
- pywikibot.output('To force a re-login, please delete the '
- "revelant lines from '{0}' (or the entire file) "
- 'and try again.'
- .format(join(config.base_dir, 'pywikibot.lwp')))
elif arg == '-logout':
logout = True
elif arg == '-oauth':
@@ -143,10 +114,6 @@
if pywikibot.bot.suggest_help(unknown_parameters=unknown_args):
return
- if password is not None:
- pywikibot.warning('The -pass argument is not implemented yet. See: '
- 'https://phabricator.wikimedia.org/T102477')
-
if logall:
namedict = config.usernames
else:
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/670801
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I0206dc544aa00a3f8673338ae5f481557a133718
Gerrit-Change-Number: 670801
Gerrit-PatchSet: 3
Gerrit-Owner: Homeboy 445 <akshitsan13(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-CC: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/668004 )
Change subject: [IMPR] only add bot option generator if the bot class have it already
......................................................................
[IMPR] only add bot option generator if the bot class have it already
Change-Id: I298ff92cda2803d38e44480f5122303215e4f9bb
---
M pywikibot/bot.py
1 file changed, 7 insertions(+), 3 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index a8945ea..8270f64 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -1173,13 +1173,17 @@
_current_page = None
def __init__(self, **kwargs):
- """
- Only accept options defined in available_options.
+ """Only accept 'generator' and options defined in available_options.
@param kwargs: bot options
+ @keyword generator: a generator processed by run method
"""
if 'generator' in kwargs:
- self.generator = kwargs.pop('generator')
+ if hasattr(self, 'generator'):
+ pywikibot.warn('{} has a generator already. Ignoring argument.'
+ .format(self.__class__.__name__))
+ else:
+ self.generator = kwargs.pop('generator')
super().__init__(**kwargs)
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/668004
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I298ff92cda2803d38e44480f5122303215e4f9bb
Gerrit-Change-Number: 668004
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: DannyS712 <DannyS712.enwiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/670163 )
Change subject: [doc] Raise a RuntimeError if -namespace is provided too late
......................................................................
[doc] Raise a RuntimeError if -namespace is provided too late
If -namespace is used together with
-newpages/-random/-randomredirect/-linter generators,
-namespace/-ns must be provided before
-newpages/-random/-randomredirect/-linter.
Raise a RuntimeError with such comment instead of
just AssertionError without this hint
Bug: T276916
Change-Id: I66906f03dc837a59f07590eac8072e1a4d54c807
---
M pywikibot/pagegenerators.py
M tests/pagegenerators_tests.py
2 files changed, 4 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index 63d27a7..56ac03a 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -927,7 +927,9 @@
def _handle_namespaces(self, value):
"""Handle `-namespaces` argument."""
- assert not isinstance(self._namespaces, frozenset)
+ if isinstance(self._namespaces, frozenset):
+ raise RuntimeError('-namespace/ns option must be provided before '
+ '-newpages/-random/-randomredirect/-linter')
if not value:
value = pywikibot.input('What namespace are you filtering on?')
NOT_KEY = 'not:'
diff --git a/tests/pagegenerators_tests.py b/tests/pagegenerators_tests.py
index 7d84dbe..b50aa56 100755
--- a/tests/pagegenerators_tests.py
+++ b/tests/pagegenerators_tests.py
@@ -707,7 +707,7 @@
gf.handle_arg('-ns:1,6')
self.assertEqual(gf.namespaces, {1, 6})
self.assertIsInstance(gf.namespaces, frozenset)
- with self.assertRaises(AssertionError):
+ with self.assertRaises(RuntimeError):
gf.handle_arg('-ns:0')
self.assertEqual(gf.namespaces, {1, 6})
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/670163
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I66906f03dc837a59f07590eac8072e1a4d54c807
Gerrit-Change-Number: 670163
Gerrit-PatchSet: 4
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-CC: DannyS712 <DannyS712.enwiki(a)gmail.com>
Gerrit-CC: Inductiveload <inductiveload(a)gmail.com>
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/669918 )
Change subject: [bugfix] Fix the issue that there are no changes in the log of contributions
......................................................................
[bugfix] Fix the issue that there are no changes in the log of contributions
Bug: T276715
Change-Id: I44fef021c95ac7f179dcb22d76f4c08619d928fc
---
M scripts/reflinks.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/reflinks.py b/scripts/reflinks.py
index 4c9c43f..a3a3ba6 100755
--- a/scripts/reflinks.py
+++ b/scripts/reflinks.py
@@ -688,7 +688,7 @@
new_text = self.deduplicator.process(new_text)
old_text = page.text
- if old_text == page.text:
+ if old_text == new_text:
return
self.userPut(page, old_text, new_text, summary=self.msg,
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/669918
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I44fef021c95ac7f179dcb22d76f4c08619d928fc
Gerrit-Change-Number: 669918
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged