jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/929027 )
Change subject: [doc] Show backslash in sphinx doc
......................................................................
[doc] Show backslash in sphinx doc
Change-Id: Iaf570e4f36b705425756c380cbb711f278695883
---
M pywikibot/tools/formatter.py
1 file changed, 15 insertions(+), 7 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/tools/formatter.py b/pywikibot/tools/formatter.py
index 768e6ca..337bfbe 100644
--- a/pywikibot/tools/formatter.py
+++ b/pywikibot/tools/formatter.py
@@ -69,16 +69,16 @@
r"""
Do ``str.format`` without having to worry about colors.
- It is automatically adding \03 in front of color fields so it's
- unnecessary to add them manually. Any other \03 in the text is
+ It is automatically adding \\03 in front of color fields so it's
+ unnecessary to add them manually. Any other \\03 in the text is
disallowed.
You may use a variant {color} by assigning a valid color to a named
parameter color.
.. deprecated:: 7.2
- new color format pattern like <<color>>colored text<<default>>
- may be used instead.
+ new color format pattern like
+ ``f'<<{color}>>colored text<<default>>'`` can be used instead.
:param text: The format template string
:return: The formatted string
@@ -103,8 +103,7 @@
text = text.format(*args, **kwargs)
except KeyError as e:
if str(e).strip("'") in colors:
- raise ValueError(
- 'Color field "{}" in "{}" uses conversion information or '
- 'format spec'.format(e, text))
+ raise ValueError(f'Color field "{e}" in "{text}" uses conversion '
+ f'information or format spec')
raise
return text
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/929027
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: Iaf570e4f36b705425756c380cbb711f278695883
Gerrit-Change-Number: 929027
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/+/926808 )
Change subject: Correct terminology around NoSiteLinkError
......................................................................
Correct terminology around NoSiteLinkError
Sitelinks are unique per wiki, not necessarily by language.
Change-Id: I315a62a51e1b035ac6be97e6267e998f3ffc6f98
---
M pywikibot/exceptions.py
M pywikibot/page/_wikibase.py
2 files changed, 21 insertions(+), 7 deletions(-)
Approvals:
Ammarpad: Looks good to me, but someone else must approve
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/exceptions.py b/pywikibot/exceptions.py
index cfe4601..e5c1a6a 100644
--- a/pywikibot/exceptions.py
+++ b/pywikibot/exceptions.py
@@ -107,7 +107,7 @@
PageLoadRelatedError: any exception which happens while loading a Page.
- InconsistentTitleError: Page receives a title inconsistent with query
- - NoSiteLinkError: ItemPage has no sitelink to given language
+ - NoSiteLinkError: ItemPage has no sitelink to given site
PageSaveRelatedError: page exceptions within the save operation on a Page
@@ -400,21 +400,21 @@
class NoSiteLinkError(PageLoadRelatedError, NoPageError):
- """ItemPage has no sitelink to the given language.
+ """ItemPage has no sitelink to the given site.
.. versionadded:: 8.1
.. deprecated:: 8.1
:exc:`NoPageError` dependency.
"""
- def __init__(self, page: 'pywikibot.page.ItemPage', lang: str) -> None:
+ def __init__(self, page: 'pywikibot.page.ItemPage', dbname: str) -> None:
"""Initializer.
:param page: ItemPage that caused the exception
- :param lang: language code of the queried sitelink
+ :param dbname: site identifier of the queried sitelink
"""
- self.message = f'Item {{}} has no sitelink to language {lang!r}'
+ self.message = f'Item {{}} has no sitelink to {dbname!r}'
super().__init__(page)
diff --git a/pywikibot/page/_wikibase.py b/pywikibot/page/_wikibase.py
index d7e9f5c..2083a3c 100644
--- a/pywikibot/page/_wikibase.py
+++ b/pywikibot/page/_wikibase.py
@@ -1078,7 +1078,8 @@
def getSitelink(self, site, force: bool = False) -> str:
"""Return the title for the specific site.
- If the item doesn't have that language, raise NoSiteLinkError.
+ If the item doesn't have a link to that site, raise
+ NoSiteLinkError.
.. versionchanged:: 8.1
raises NoSiteLinkError instead of NoPageError.
@@ -1095,7 +1096,9 @@
self.get(force=force)
if site not in self.sitelinks:
- raise NoSiteLinkError(self, site.lang)
+ if not isinstance(site, str):
+ site = site.dbName()
+ raise NoSiteLinkError(self, site)
return self.sitelinks[site].canonical_title()
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/926808
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: I315a62a51e1b035ac6be97e6267e998f3ffc6f98
Gerrit-Change-Number: 926808
Gerrit-PatchSet: 3
Gerrit-Owner: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Ammarpad <ammarpad(a)yahoo.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/i18n/+/928494 )
Change subject: Localisation updates from https://translatewiki.net.
......................................................................
Localisation updates from https://translatewiki.net.
Change-Id: Idafc71e9416f1378758186a9f428b793e2a3acec
---
M checkimages/vi.json
M protect/nl.json
M basic/vi.json
M unprotect/nl.json
A delinker/nl.json
M category/vi.json
6 files changed, 24 insertions(+), 5 deletions(-)
Approvals:
L10n-bot: Looks good to me, approved
jenkins-bot: Verified
diff --git a/basic/vi.json b/basic/vi.json
index 9211fa0..4551434 100644
--- a/basic/vi.json
+++ b/basic/vi.json
@@ -5,5 +5,5 @@
"Minh Nguyen"
]
},
- "basic-changing": "Bot: Thay đổi ..."
+ "basic-changing": "Bot: Thay đổi…"
}
diff --git a/category/vi.json b/category/vi.json
index ec5765f..a453aba 100644
--- a/category/vi.json
+++ b/category/vi.json
@@ -11,7 +11,7 @@
"category-listifying": "Bot: Danh sách hóa từ %(fromcat)s (%(num)d trang)",
"category-removing": "Bot: Dời %(oldcat)s",
"category-renamed": "Bot: Di chuyển từ %(oldcat)s. Tác giả: %(authors)s",
- "category-replacing": "Bot: Di chuyển %(oldcat)s sang %(newcat)s",
+ "category-replacing": "Bot: Thay thể loại %(oldcat)s bằng %(newcat)s",
"category-section-title": "Lịch sử các trang từng nằm trong %(oldcat)s",
"category-strip-cfd-templates": "Bot: Gỡ bản mẫu đề nghị xóa thể loại vì đã được giải quyết",
"category-strip-sort-keys": "Bot: Gỡ từ khóa sắp xếp vì tác vụ đã được giải quyết",
diff --git a/checkimages/vi.json b/checkimages/vi.json
index 96eb45d..18fefe2 100644
--- a/checkimages/vi.json
+++ b/checkimages/vi.json
@@ -12,7 +12,7 @@
"checkimages-log-comment": "Bot: Cập nhật nhật trình",
"checkimages-no-license-head": "Tập tin thiếu giấy phép",
"checkimages-source-tag-comment": "Bot: Đánh dấu tập tin mới tải lên chưa gắn thẻ",
- "checkimages-source-notice-comment": "Bot: Yêu cầu thông tin nguồn gốc.",
+ "checkimages-source-notice-comment": "Bot: Yêu cầu thông tin nguồn gốc",
"checkimages-unknown-extension-head": "Phần mở rộng không rõ!",
"checkimages-unknown-extension-msg": "Tên tập tin %(file)s hình như có phần mở rộng sai, xin hãy xem lại."
}
diff --git a/delinker/nl.json b/delinker/nl.json
new file mode 100644
index 0000000..accbab0
--- /dev/null
+++ b/delinker/nl.json
@@ -0,0 +1,8 @@
+{
+ "@metadata": {
+ "authors": [
+ "HanV"
+ ]
+ },
+ "delinker-delink": "Bot: het bestand [[%(title)s]] is verwijderd, want dat bestand is verwijderd door [[:User:%(user)s]]: ''%(comment)s''"
+}
diff --git a/protect/nl.json b/protect/nl.json
index f3bbbcd..682e188 100644
--- a/protect/nl.json
+++ b/protect/nl.json
@@ -1,6 +1,7 @@
{
"@metadata": {
"authors": [
+ "HanV",
"McDutchie",
"Siebrand"
]
@@ -8,6 +9,6 @@
"protect-category": "Robot: alle pagina's uit categorie %(cat)s beveiligd",
"protect-images": "Robot: alle op %(page)s gebruikte bestanden beveiligd",
"protect-links": "Robot: alle pagina's met verwijzingen vanaf %(page)s beveiligd",
- "protect-ref": "Robot: alle pagina's met een verwijzing op %(page)s beveiligd",
+ "protect-ref": "Bot: alle pagina's met een verwijzing naar %(page)s beveiligen",
"protect-simple": "Robot: lijst met bestanden beveiligd"
}
diff --git a/unprotect/nl.json b/unprotect/nl.json
index 7d39000..e899300 100644
--- a/unprotect/nl.json
+++ b/unprotect/nl.json
@@ -1,6 +1,7 @@
{
"@metadata": {
"authors": [
+ "HanV",
"McDutchie",
"Siebrand"
]
@@ -8,6 +9,6 @@
"unprotect-category": "Robot: beveiliging voor alle pagina's uit categorie %(cat)s opgeheven",
"unprotect-images": "Robot: beveiliging van alle bestanden op pagina %(page)s opgeheven",
"unprotect-links": "Robot: beveiliging van alle vanaf %(page)s gekoppelde pagina's opgeheven",
- "unprotect-ref": "Robot: beveiliging van alle pagina's met een koppeling naar %(page)s opgeheven",
+ "unprotect-ref": "Bot: beveiliging van alle pagina's met een koppeling naar %(page)s opheffen",
"unprotect-simple": "Robot: beveiliging van een lijst met bestanden opgeheven"
}
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/i18n/+/928494
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: Idafc71e9416f1378758186a9f428b793e2a3acec
Gerrit-Change-Number: 928494
Gerrit-PatchSet: 1
Gerrit-Owner: L10n-bot <l10n-bot(a)translatewiki.net>
Gerrit-Reviewer: L10n-bot <l10n-bot(a)translatewiki.net>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged