jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/904767 )
Change subject: [test] stdnum 1.18+ is required, force it for tests
......................................................................
[test] stdnum 1.18+ is required, force it for tests
Change-Id: Id1cbcfbd5250e7c0f58c1e7f23511203123c5715
---
M tests/cosmetic_changes_tests.py
1 file changed, 10 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/cosmetic_changes_tests.py b/tests/cosmetic_changes_tests.py
index 9073fac..4c41716 100755
--- a/tests/cosmetic_changes_tests.py
+++ b/tests/cosmetic_changes_tests.py
@@ -562,7 +562,7 @@
@classmethod
def setUpClass(cls):
"""Skip tests if isbn libraries are missing."""
- if not has_module('stdnum', version='1.17'):
+ if not has_module('stdnum', version='1.18'):
raise unittest.SkipTest('python-stdnum is not available.')
super().setUpClass()
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/904767
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: Id1cbcfbd5250e7c0f58c1e7f23511203123c5715
Gerrit-Change-Number: 904767
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
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/i18n/+/904454 )
Change subject: [i18n] Fix protect-ref and unprotect-ref messages
......................................................................
[i18n] Fix protect-ref and unprotect-ref messages
https://translatewiki.net/wiki/Thread:Support/About_Pywikibot:Protect-ref/e…
Change-Id: Ibb924c42716448be013eac1bddbf0724e8fea2e0
---
M protect/qqq.json
M unprotect/en.json
M protect/en.json
3 files changed, 21 insertions(+), 5 deletions(-)
Approvals:
MarcoAurelio: Looks good to me, approved
jenkins-bot: Verified
diff --git a/protect/en.json b/protect/en.json
index d523d9f..2df38e6 100644
--- a/protect/en.json
+++ b/protect/en.json
@@ -1,8 +1,12 @@
{
- "@metadata": [],
+ "@metadata": {
+ "authors": [
+ "Xqt"
+ ]
+ },
"protect-category": "Bot: Protecting all pages from category %(cat)s",
"protect-images": "Bot: Protecting all images on page %(page)s",
"protect-links": "Bot: Protecting all pages linked from %(page)s",
- "protect-ref": "Bot: Protecting all pages referring from %(page)s",
+ "protect-ref": "Bot: Protecting all pages referring to %(page)s",
"protect-simple": "Bot: Protecting a list of files."
}
diff --git a/protect/qqq.json b/protect/qqq.json
index 4dd80cf..61d8a22 100644
--- a/protect/qqq.json
+++ b/protect/qqq.json
@@ -10,6 +10,6 @@
"protect-category": "Edit summary when the bot protects all pages from a category. Parameters:\n* %(cat)s - category name\nSee also:\n* {{msg-pywikibot|Delete-from-category}}",
"protect-images": "Edit summary when the bot protects all images on a page. Parameters:\n* %(page)s - page title\nSee also:\n* {{msg-pywikibot|Delete-images}}",
"protect-links": "Edit summary when the bot protects all pages linked from a page. Parameters:\n* $(page)s - page title\nSee also:\n* {{msg-pywikibot|Delete-linked-pages}}",
- "protect-ref": "Edit summary when the bot protects all pages that link to/transclude a page (Special:WhatLinksHere); \"referring from\" can also be translated as \"linked from\". Parameters:\n* %(page)s - page title\nSee also:\n* {{msg-pywikibot|Delete-referring-pages}}",
+ "protect-ref": "Edit summary when the bot protects all pages that link to/transclude a page (Special:WhatLinksHere); \"referring to\" can also be translated as \"linked from\". Parameters:\n* %(page)s - page title\nSee also:\n* {{msg-pywikibot|Delete-referring-pages}}",
"protect-simple": "Edit summary when the bot protects a list of files."
}
diff --git a/unprotect/en.json b/unprotect/en.json
index 464d57b..ea886f7 100644
--- a/unprotect/en.json
+++ b/unprotect/en.json
@@ -1,12 +1,13 @@
{
"@metadata": {
"authors": [
- "Sn1per"
+ "Sn1per",
+ "Xqt"
]
},
"unprotect-category": "Bot: Unprotecting all pages from category %(cat)s",
"unprotect-images": "Bot: Unprotecting all files on page %(page)s",
"unprotect-links": "Bot: Unprotecting all pages linked from %(page)s",
- "unprotect-ref": "Bot: Unprotecting all pages referring from %(page)s",
+ "unprotect-ref": "Bot: Unprotecting all pages referring to %(page)s",
"unprotect-simple": "Bot: Unprotecting a list of files"
}
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/i18n/+/904454
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/i18n
Gerrit-Branch: master
Gerrit-Change-Id: Ibb924c42716448be013eac1bddbf0724e8fea2e0
Gerrit-Change-Number: 904454
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: MarcoAurelio <maurelio(a)toolforge.org>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/i18n/+/904451 )
Change subject: [i18n] Remove fullstop at the end of the message
......................................................................
[i18n] Remove fullstop at the end of the message
https://translatewiki.net/wiki/Thread:Translating_talk:Pywikibot/About_Pywi…
Change-Id: Ic64bb190d4a8311aab260e84745e82048bc8b533
---
M delinker/en.json
1 file changed, 12 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/delinker/en.json b/delinker/en.json
index eb4bbf7..bf153b8 100644
--- a/delinker/en.json
+++ b/delinker/en.json
@@ -4,5 +4,5 @@
"Xqt"
]
},
- "delinker-delink": "Bot: The file [[%(title)s]] has been removed, as it has been deleted by [[:User:%(user)s]]: ''%(comment)s''."
+ "delinker-delink": "Bot: The file [[%(title)s]] has been removed, as it has been deleted by [[:User:%(user)s]]: ''%(comment)s''"
}
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/i18n/+/904451
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/i18n
Gerrit-Branch: master
Gerrit-Change-Id: Ic64bb190d4a8311aab260e84745e82048bc8b533
Gerrit-Change-Number: 904451
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
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/+/904272 )
Change subject: [IMPR] us f-strings in archivebot.py
......................................................................
[IMPR] us f-strings in archivebot.py
Change-Id: Ie8362feec9d715e0d538bd1b40a9a6c7d138ae17
---
M scripts/archivebot.py
1 file changed, 25 insertions(+), 28 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/archivebot.py b/scripts/archivebot.py
index baba69b..f499e02 100755
--- a/scripts/archivebot.py
+++ b/scripts/archivebot.py
@@ -163,8 +163,7 @@
class MissingConfigError(ArchiveBotSiteConfigError):
- """
- The config is missing in the header.
+ """The config is missing in the header.
It's in one of the threads or transcluded from another page.
"""
@@ -172,8 +171,7 @@
class ArchiveSecurityError(ArchiveBotSiteConfigError):
- """
- Page title is not a valid archive of page being archived.
+ """Page title is not a valid archive of page being archived.
The page title is neither a subpage of the page being archived,
nor does it match the key specified in the archive configuration template.
@@ -181,8 +179,7 @@
def str2localized_duration(site, string: str) -> str:
- """
- Localise a shorthand duration.
+ """Localise a shorthand duration.
Translates a duration written in the shorthand notation (ex. "24h", "7d")
into an expression in the local wiki language ("24 hours", "7 days").
@@ -200,8 +197,7 @@
def str2size(string: str) -> Size:
- """
- Return a size for a shorthand size.
+ """Return a size for a shorthand size.
Accepts a string defining a size::
@@ -227,8 +223,7 @@
def template_title_regex(tpl_page: pywikibot.Page) -> Pattern:
- """
- Return a regex that matches to variations of the template title.
+ """Return a regex that matches to variations of the template title.
It supports the transcluding variant as well as localized namespaces and
case-insensitivity depending on the namespace.
@@ -296,8 +291,7 @@
self.timestamp = max(self.timestamp, timestamp)
def size(self) -> int:
- """
- Return size of discussion thread.
+ """Return size of discussion thread.
Note that the result is NOT equal to that of
len(self.to_text()). This method counts bytes, rather than
@@ -314,8 +308,7 @@
class DiscussionPage(pywikibot.Page):
- """
- A class that represents a single page of discussion threads.
+ """A class that represents a single page of discussion threads.
Feed threads to it and run an update() afterwards.
"""
@@ -411,8 +404,7 @@
# This extra info is not desirable when run under the unittest
# framework, which may be run either directly or via setup.py
if pywikibot.calledModuleName() not in ['archivebot_tests', 'setup']:
- pywikibot.info('{} thread(s) found on {}'
- .format(len(self.threads), self))
+ pywikibot.info(f'{len(self.threads)} thread(s) found on {self}')
def is_full(self, max_archive_size: Size) -> bool:
"""Check whether archive size exceeded."""
@@ -551,8 +543,8 @@
def load_config(self) -> None:
"""Load and validate archiver template."""
- pywikibot.info('Looking for: {{{{{}}}}} in {}'
- .format(self.tpl.title(), self.page))
+ pywikibot.info(
+ f'Looking for: {{{{{self.tpl.title()}}}}} in {self.page}')
for tpl, params in self.page.raw_extracted_templates:
try: # Check tpl name before comparing; it might be invalid.
@@ -570,13 +562,12 @@
for field in ('algo', 'archive'):
if not self.get_attr(field, ''):
- raise MissingConfigError('Missing argument {!r} in template'
- .format(field))
+ raise MissingConfigError(
+ f'Missing argument {field!r} in template')
def should_archive_thread(self, thread: DiscussionThread
) -> Optional[ShouldArchive]:
- """
- Check whether a thread has to be archived.
+ """Check whether a thread has to be archived.
:return: the archivation reason as a tuple of localization args
"""
@@ -640,8 +631,7 @@
max_size = self.get_attr('maxarchivesize')
max_arch_size = str2size(max_size)
if not max_arch_size[0]:
- raise MalformedConfigError('invalid maxarchivesize {!r}'
- .format(max_size))
+ raise MalformedConfigError(f'invalid maxarchivesize {max_size!r}')
counter = int(self.get_attr('counter', '1'))
pattern = self.get_attr('archive')
@@ -831,11 +821,9 @@
archiver.run()
except ArchiveBotSiteConfigError as e:
# no stack trace for errors originated by pages on-site
- pywikibot.error('Missing or malformed template in page {}: {}'
- .format(page, e))
+ pywikibot.error(f'Missing or malformed template in page {page}: {e}')
except Exception:
- pywikibot.exception('Error occurred while processing page {}'
- .format(page))
+ pywikibot.exception(f'Error occurred while processing page {page}')
except KeyboardInterrupt:
pywikibot.info('\nUser quit bot run...')
return False
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/904272
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: Ie8362feec9d715e0d538bd1b40a9a6c7d138ae17
Gerrit-Change-Number: 904272
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