jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/i18n/+/777383 )
Change subject: [i18n] Add delinker bot summary to the i18n system
......................................................................
[i18n] Add delinker bot summary to the i18n system
Bug: T299563
Change-Id: I44eb0e7aeab13300b5d036184cccd441369d1db0
---
A delinker/en.json
A delinker/qqq.json
2 files changed, 16 insertions(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/delinker/en.json b/delinker/en.json
new file mode 100644
index 0000000..eb4bbf7
--- /dev/null
+++ b/delinker/en.json
@@ -0,0 +1,8 @@
+{
+ "@metadata": {
+ "authors": [
+ "Xqt"
+ ]
+ },
+ "delinker-delink": "Bot: The file [[%(title)s]] has been removed, as it has been deleted by [[:User:%(user)s]]: ''%(comment)s''."
+}
diff --git a/delinker/qqq.json b/delinker/qqq.json
new file mode 100644
index 0000000..104d500
--- /dev/null
+++ b/delinker/qqq.json
@@ -0,0 +1,8 @@
+{
+ "@metadata": {
+ "authors": [
+ "Xqt"
+ ]
+ },
+ "delinker-delink": "Edit summary when the bot delinks a file due to its deletion. %(title)s contains the file title, %(user)s is the user name who has deleted the file and %(comment)s contains the deletion reason."
+}
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/i18n/+/777383
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: I44eb0e7aeab13300b5d036184cccd441369d1db0
Gerrit-Change-Number: 777383
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: MarcoAurelio <maurelio(a)toolforge.org>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Rubin <rubin.happy(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-CC: Meno25 <meno25mail(a)gmail.com>
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/777022 )
Change subject: [doc] Update documentation
......................................................................
[doc] Update documentation
* Fix link syntax
Change-Id: I33fc31410bd76950d2a452525f7d3e4a9f19dc99
---
M docs/scripts/outdated.rst
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Meno25: Looks good to me, approved
jenkins-bot: Verified
diff --git a/docs/scripts/outdated.rst b/docs/scripts/outdated.rst
index 4422ec0..9f06f81 100644
--- a/docs/scripts/outdated.rst
+++ b/docs/scripts/outdated.rst
@@ -16,7 +16,7 @@
catimages script
----------------
-**Image by content categorization** (:phab:`T66838)`
+**Image by content categorization** (:phab:`T66838`)
Script to check uncategorized files. This script checks if a file
has some content that allows to assign it to a category.
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/777022
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: I33fc31410bd76950d2a452525f7d3e4a9f19dc99
Gerrit-Change-Number: 777022
Gerrit-PatchSet: 3
Gerrit-Owner: Meno25 <meno25mail(a)gmail.com>
Gerrit-Reviewer: Meno25 <meno25mail(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/777297 )
Change subject: [bugfix] Python 3.5 does not support inline flags inside groups
......................................................................
[bugfix] Python 3.5 does not support inline flags inside groups
Also make textlib._ignore_case a public method
Bug: T305226
Change-Id: Idc6d286ac420059d76cdc23f6f0b50c2f5d29869
---
M pywikibot/textlib.py
M scripts/image.py
2 files changed, 16 insertions(+), 12 deletions(-)
Approvals:
Matěj Suchánek: Looks good to me, but someone else must approve
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 9d32247..8b16d4e 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -211,8 +211,8 @@
pattern = case_escape(namespace.case, old)
# namespaces may be any mixed case
- namespaces = [_ignore_case(ns) for ns in namespace]
- namespaces.append(_ignore_case('msg'))
+ namespaces = [ignore_case(ns) for ns in namespace]
+ namespaces.append(ignore_case('msg'))
pattern = re.sub(r'_|\\ ', r'[_ ]', pattern)
templateRegexP = (
r'{{\s*(%(namespace)s:)?%(pattern)s'
@@ -229,8 +229,12 @@
return lambda text: any(predicate(text) for predicate in predicates)
-def _ignore_case(string: str) -> str:
- """Return a case-insensitive pattern for the string."""
+def ignore_case(string: str) -> str:
+ """Return a case-insensitive pattern for the string.
+
+ .. versionchanged:: 7.2
+ `_ignore_case` becomes a public method
+ """
return ''.join(
'[{}{}]'.format(c, s) if c != s else c
for s, c in zip(string, string.swapcase()))
@@ -242,7 +246,7 @@
r'<{0}(?:>|\s+[^>]*(?<!/)>)' # start tag
r'[\s\S]*?' # contents
r'</{0}\s*>' # end tag
- .format(_ignore_case(tag_name)))
+ .format(ignore_case(tag_name)))
def _tag_regex(tag_name: str):
@@ -270,24 +274,24 @@
'interwiki': (
r'\[\[:?(%s)\s?:[^\]]*\]\]\s*',
lambda site: '|'.join(
- _ignore_case(i) for i in site.validLanguageLinks()
+ ignore_case(i) for i in site.validLanguageLinks()
+ list(site.family.obsolete.keys()))),
# Module invocations (currently only Lua)
'invoke': (
r'\{\{\s*\#(?:%s):[\s\S]*?\}\}',
lambda site: '|'.join(
- _ignore_case(mw) for mw in site.getmagicwords('invoke'))),
+ ignore_case(mw) for mw in site.getmagicwords('invoke'))),
# this matches internal wikilinks, but also interwiki, categories, and
# images.
'link': re.compile(r'\[\[[^\]|]*(\|[^\]]*)?\]\]'),
# pagelist tag (used in Proofread extension).
'pagelist': re.compile(r'<{}[\s\S]*?/>'
- .format(_ignore_case('pagelist'))),
+ .format(ignore_case('pagelist'))),
# Wikibase property inclusions
'property': (
r'\{\{\s*\#(?:%s):\s*[Pp]\d+.*?\}\}',
lambda site: '|'.join(
- _ignore_case(mw) for mw in site.getmagicwords('property'))),
+ ignore_case(mw) for mw in site.getmagicwords('property'))),
# lines that start with a colon or more will be indented
'startcolon': re.compile(r'(?:(?<=\n)|\A):(.*?)(?=\n|\Z)'),
# lines that start with a space are shown in a monospace font and
diff --git a/scripts/image.py b/scripts/image.py
index a52a208..84785e7 100755
--- a/scripts/image.py
+++ b/scripts/image.py
@@ -46,7 +46,7 @@
import pywikibot
from pywikibot import i18n, pagegenerators
from pywikibot.bot import SingleSiteBot
-from pywikibot.textlib import case_escape
+from pywikibot.textlib import case_escape, ignore_case
from scripts.replace import ReplaceRobot as ReplaceBot
@@ -91,8 +91,8 @@
escaped = re.sub('\\\\[_ ]', '[_ ]', escaped)
if not self.opt.loose or not self.new_image:
image_regex = re.compile(
- r'\[\[ *(?i:{})\s*:\s*{} *(?P<parameters>\|[^\n]+?|) *\]\]'
- .format('|'.join(namespace), escaped))
+ r'\[\[ *(?:{})\s*:\s*{} *(?P<parameters>\|[^\n]+?|) *\]\]'
+ .format('|'.join(ignore_case(s) for s in namespace), escaped))
else:
image_regex = re.compile(r'' + escaped)
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/777297
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: Idc6d286ac420059d76cdc23f6f0b50c2f5d29869
Gerrit-Change-Number: 777297
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97(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/+/777296 )
Change subject: [bugfix] Take into account that global account may be missing
......................................................................
[bugfix] Take into account that global account may be missing
Don't try to upcast timestamp from global userinfo if global account
does not exists.
Bug: T305351
Change-Id: I9863917543db1a1730477e4b30472474ee58ee2a
---
M pywikibot/site/_apisite.py
1 file changed, 3 insertions(+), 2 deletions(-)
Approvals:
Meno25: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py
index 4cfe63a..2210ec9 100644
--- a/pywikibot/site/_apisite.py
+++ b/pywikibot/site/_apisite.py
@@ -557,8 +557,9 @@
assert 'globaluserinfo' in uidata['query'], \
"API userinfo response lacks 'globaluserinfo' key"
data = uidata['query']['globaluserinfo']
- ts = data['registration']
- data['registration'] = pywikibot.Timestamp.fromISOformat(ts)
+ if 'missing' not in data:
+ ts = data['registration']
+ data['registration'] = pywikibot.Timestamp.fromISOformat(ts)
self._globaluserinfo[user] = data
return self._globaluserinfo[user]
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/777296
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: I9863917543db1a1730477e4b30472474ee58ee2a
Gerrit-Change-Number: 777296
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Meno25 <meno25mail(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/752362 )
Change subject: [7.0] remove scripts archived in 6.0
......................................................................
[7.0] remove scripts archived in 6.0
Bug: T223826
Change-Id: If2bcb6b7a7b34f50852e7d5b1a025494e648320e
---
M .codeclimate.yml
M .codecov.yml
M .deepsource.toml
M scripts/README.rst
D scripts/archive/README.rst
D scripts/archive/__init__.py
D scripts/archive/capitalize_redirects.py
D scripts/archive/casechecker.py
D scripts/archive/catall.py
D scripts/archive/commons_link.py
D scripts/archive/create_categories.py
D scripts/archive/disambredir.py
D scripts/archive/editarticle.py
D scripts/archive/flickrripper.py
D scripts/archive/followlive.py
D scripts/archive/freebasemappingupload.py
D scripts/archive/imagecopy.py
D scripts/archive/imagecopy_self.py
D scripts/archive/imageharvest.py
D scripts/archive/imagerecat.py
D scripts/archive/imageuncat.py
D scripts/archive/isbn.py
D scripts/archive/lonelypages.py
D scripts/archive/makecat.py
D scripts/archive/match_images.py
D scripts/archive/ndashredir.py
D scripts/archive/piper.py
D scripts/archive/selflink.py
D scripts/archive/spamremove.py
D scripts/archive/standardize_interwiki.py
D scripts/archive/states_redirect.py
D scripts/archive/surnames_redirects.py
D scripts/archive/table2wiki.py
D scripts/archive/unlink.py
D scripts/archive/wikisourcetext.py
D tests/archive/__init__.py
D tests/archive/disambredir_tests.py
D tests/archive/imagecopy_tests.py
D tests/archive/isbn_tests.py
M tox.ini
40 files changed, 6 insertions(+), 9,698 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/752362
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: If2bcb6b7a7b34f50852e7d5b1a025494e648320e
Gerrit-Change-Number: 752362
Gerrit-PatchSet: 3
Gerrit-Owner: JJMC89 <JJMC89.Wikimedia(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/776346 )
Change subject: [doc] use descriptions from scripts for archived scripts
......................................................................
[doc] use descriptions from scripts for archived scripts
- change header
- remove compats us-states which is states_redirect
Change-Id: Iba4e13b9449754e8ed4601c962490ae9d733551f
---
M docs/scripts/archive.rst
M docs/scripts/outdated.rst
2 files changed, 164 insertions(+), 74 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/docs/scripts/archive.rst b/docs/scripts/archive.rst
index 70a929b..107e990 100644
--- a/docs/scripts/archive.rst
+++ b/docs/scripts/archive.rst
@@ -1,180 +1,276 @@
-Archived scripts
-================
+Outdated core scripts
+=====================
-.. automodule:: scripts.archive
-.. seealso:: :ref:`Outdated scripts`
+This list contains outdated scripts from :term:`core` banch which
+aren't supported any longer. They are either archived or deleted.
+
+Feel free to reactivate any script at any time by creating a Phabricator
+task: :phab:`Recovery request
+<maniphest/task/edit/form/1/?projects=pywikibot,pywikibot-scripts&title=Recover
+Pywikibot%20script:%20>`
+
+.. seealso:: :ref:`Outdated compat scripts`
+
capitalize\_redirects script
----------------------------
-.. automodule:: scripts.archive.capitalize_redirects
- :no-members:
+**Bot to create capitalized redirects**
+
+It creates redirects where the first character of the first
+word is uppercase and the remaining characters and words are lowercase.
+
casechecker script
------------------
-.. automodule:: scripts.archive.casechecker
- :no-members:
+**Bot to find all pages on the wiki with mixed latin and cyrilic alphabets**
catall script
-------------
-.. automodule:: scripts.archive.catall
- :no-members:
+**This script shows the categories on each page and lets you change them**
+
+For each page in the target wiki:
+
+ - If the page contains no categories, you can specify a list of categories to
+ add to the page.
+ - If the page already contains one or more categories, you can specify a new
+ list of categories to replace the current list of categories of the page.
+
commons\_link script
--------------------
-.. automodule:: scripts.archive.commons_link
- :no-members:
+**Include Commons template in home wiki**
+
+This bot functions mainly in the en.wikipedia, because it
+compares the names of articles and category in English
+language (standard language in Commons). If the name of
+an article in Commons will not be in English but with
+redirect, this also functions.
create_categories script
------------------------
-.. automodule:: scripts.archive.create_categories
- :no-members:
+**Program to batch create categories**
+
+The program expects a generator of category titles to be used
+as suffix for creating new categories with a different base.
+
disambredirs script
-------------------
-.. automodule:: scripts.archive.disambredir
- :no-members:
+**User assisted updating redirect links on disambiguation pages**
+
editarticle script
------------------
-.. automodule:: scripts.archive.editarticle
- :no-members:
+**Edit a Wikipedia article with your favourite editor**
+
flickrripper script
-------------------
-.. automodule:: scripts.archive.flickrripper
- :no-members:
+**A tool to transfer flickr photos to Wikimedia Commons**
+
followlive
----------
-.. automodule:: scripts.archive.followlive
- :no-members:
+**Periodically grab list of new articles and analyze to blank or flag them**
+
+Script to follow new articles on the wiki and flag them
+with a template or eventually blank them.
+
freebasemappingupload script
----------------------------
-.. automodule:: scripts.archive.freebasemappingupload
- :no-members:
+**Script to upload the mappings of Freebase to Wikidata**
+
+Can be easily adapted to upload other String identifiers as well.
+
+This bot needs the dump from
+https://developers.google.com/freebase/data#freebase-wikidata-mappings
+
imagecopy script
----------------
-.. automodule:: scripts.archive.imagecopy
- :no-members:
+**Script to copy files from a local Wikimedia wiki to Wikimedia Commons**
+
+It uses CommonsHelper to not leave any information out and CommonSense
+to automatically categorise the file. After copying, a NowCommons
+template is added to the local wiki's file. It uses a local exclusion
+list to skip files with templates not allow on Wikimedia Commons. If no
+categories have been found, the file will be tagged on Commons.
+
+This bot uses a graphical interface and may not work from commandline
+only environment.
+
imagecopy\_self script
----------------------
-.. automodule:: scripts.archive.imagecopy_self
- :no-members:
+**Script to copy self published files from English Wikipedia to Commons**
+
+This bot is based on imagecopy.py and intended to be used to empty out
+https://en.wikipedia.org/wiki/Category:Self-published_work
+
+This bot uses a graphical interface and may not work from commandline
+only environment.
+
imageharvest script
-------------------
-.. automodule:: scripts.archive.imageharvest
- :no-members:
+**Bot for getting multiple images from an external site**
+
+It takes a URL as an argument and finds all images (and other files specified
+by the extensions in 'file_formats' that URL is referring to, asking whether to
+upload them. If further arguments are given, they are considered to be the text
+that is common to the descriptions. BeautifulSoup is needed only in this case.
+
+A second use is to get a number of images that have URLs only differing in
+numbers. To do this, use the command line option "-pattern", and give the URL
+with the variable part replaced by '$' (if that character occurs in the URL
+itself, you will have to change the bot code, my apologies).
+
imagerecat script
-----------------
-.. automodule:: scripts.archive.imagerecat
- :no-members:
+**Program to re-categorize images at commons**
+
+The program uses read the current categories, put the categories through
+some filters and adds the result.
+
imageuncat script
-----------------
-.. automodule:: scripts.archive.imageuncat
- :no-members:
+**Program to add uncat template to images without categories at commons**
+
+See :ref:`imagerecat script` to add these images to categories.
+
+This script is working on the given site, so if the commons should be handled,
+the site commons should be given and not a Wikipedia or similar.
isbn script
-----------
-.. automodule:: scripts.archive.isbn
- :no-members:
+**This script reports and fixes invalid ISBN numbers**
+
+Additionally, it can convert all ISBN-10 codes to the ISBN-13 format, and
+correct the ISBN format by placing hyphens.
+
lonelypages script
------------------
-.. automodule:: scripts.archive.lonelypages
- :no-members:
+**This is a script written to add the template "orphan" to pages**
+
makecat script
--------------
-.. automodule:: scripts.archive.makecat
- :no-members:
+**Bot to add new or existing categories to pages**
+
+This bot takes as its argument the name of a new or existing category.
+Multiple categories may be given. It will then try to find new articles
+for these categories (pages linked to and from pages already in the category),
+asking the user which pages to include and which not.
+
match\_images script
--------------------
-.. automodule:: scripts.archive.match_images
- :no-members:
+**Program to match two images based on histograms**
+
ndashredir script
-----------------
-.. automodule:: scripts.archive.ndashredir
- :no-members:
+**A script to create hyphenated redirects for n or m dash pages**
+
+This script collects pages with n or m dash in their title and creates
+a redirect from the corresponding hyphenated version. If the redirect
+already exists, it is skipped.
+
+Use -reversed option to create n dash redirects for hyphenated pages.
+Some communities can decide to use hyphenated titles for templates, modules
+or categories and in this case this option can be handy.
+
piper script
------------
-.. automodule:: scripts.archive.piper
- :no-members:
+**This bot uses external filtering programs for munging text**
+
selflink script
---------------
-.. automodule:: scripts.archive.selflink
- :no-members:
+**This bot searches for selflinks and allows removing them**
+
spamremove script
-----------------
-.. automodule:: scripts.archive.spamremove
- :no-members:
+**Script to remove links that are being or have been spammed**
+
standardize\_interwiki script
-----------------------------
-.. automodule:: scripts.archive.standardize_interwiki
- :no-members:
+**Loop over all pages in the home wiki, standardizing the interwiki links**
+
states\_redirect script
-----------------------
-.. automodule:: scripts.archive.states_redirect
- :no-members:
+**Create country sub-division redirect pages**
+
+Check if they are in the form `Something, State`, and if so, create a redirect
+from `Something, ST`.
+
surnames\_redirects script
--------------------------
-.. automodule:: scripts.archive.surnames_redirects
- :no-members:
+**Bot to create redirects based on name order**
+
+By default it creates a "Surnames, Given Names" redirect
+version of a given page where title consists of 2 or 3 titlecased words.
+
table2wiki script
-----------------
-.. automodule:: scripts.archive.table2wiki
- :no-members:
+**Nifty script to convert HTML-tables to MediaWiki's own syntax**
+
unlink script
-------------
-.. automodule:: scripts.archive.unlink
- :no-members:
+**This bot unlinks a page on every page that links to it**
+
wikisourcetext script
---------------------
-.. automodule:: scripts.archive.wikisourcetext
- :no-members:
+**This bot applies to Wikisource sites to upload text**
+
+Text is uploaded to pages in Page ns, for a specified Index.
+Text to be stored, if the page is not-existing, is preloaded from the file used
+to create the Index page, making the upload feature independent from the format
+of the file, as long as it is supported by the MW ProofreadPage extension.
+
+As alternative, if '-ocr' option is selected,
+OCR tool will be used to get text.
+In this case, also already existing pages with quality value 'Not Proofread'
+can be treated. '-force' will override existing page in this case.
diff --git a/docs/scripts/outdated.rst b/docs/scripts/outdated.rst
index 5729578..4422ec0 100644
--- a/docs/scripts/outdated.rst
+++ b/docs/scripts/outdated.rst
@@ -1,15 +1,16 @@
-Outdated scripts
-================
+Outdated compat scripts
+=======================
This list contains outdated scripts from :term:`compat` banch which
-haven't ported to the current :term:`core` branch of Pywikibot |version|.
+haven't ported to the :term:`core` branch of Pywikibot.
+
Feel free to reactivate any script at any time by creating a Phabricator
task (:phab:`Porting request
<maniphest/task/edit/form/1/?projects=pywikibot,pywikibot-scripts,Pywikibot-compat-to-core&title=Port
Pywikibot%20compat%20script%20to%20core:%20>`)
or reactivate the specified task below.
-.. seealso:: :ref:`Archived scripts`
+.. seealso:: :ref:`Outdated core scripts`
catimages script
@@ -65,6 +66,7 @@
---------------------
**Script to put reports of copyright.py to wiki page** (:phab:`T66848`)
+
deledpimage script
------------------
**Script to remove EDP images in non-article namespaces** (:phab:`T66849`)
@@ -167,14 +169,6 @@
(:phab:`66159`)
-us\_states script
------------------
-**Check pages on the whether they are in common form**
-
-On English Wikipedia the common form is like `Something, State`
-and if so, create a redirect from `Something, ST`.
-
-
warnfile script
---------------
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/776346
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: Iba4e13b9449754e8ed4601c962490ae9d733551f
Gerrit-Change-Number: 776346
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-MessageType: merged
Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/776324 )
Change subject: [doc] Add outdated scripts to sphinx docs
......................................................................
[doc] Add outdated scripts to sphinx docs
- add outdated scripts to sphinx docs
- add utilities scripts without members as description ans usage
documentation
Change-Id: I72a446f26fe9dcac0d4b7c3da98a03c211e9ab4d
---
M CREDITS.rst
M docs/index.rst
M docs/scripts/archive.rst
M docs/scripts/index.rst
A docs/scripts/outdated.rst
C docs/utilities/scripts.rst
R docs/utilities/scripts_ref.rst
M pwb.py
M pywikibot/page/_filepage.py
M pywikibot/scripts/__init__.py
M pywikibot/scripts/shell.py
M scripts/archive/__init__.py
12 files changed, 217 insertions(+), 20 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/CREDITS.rst b/CREDITS.rst
index 6d2a629..685b6a7 100644
--- a/CREDITS.rst
+++ b/CREDITS.rst
@@ -269,6 +269,7 @@
Robert Leverington
Rob W.W. Hooft
Rotem Liss
+ Rua
Russell Blau
S
diff --git a/docs/index.rst b/docs/index.rst
index 437704c..927ad30 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -20,18 +20,19 @@
``python`` at the CMD or shell prompt.
Python 3.5.3 or higher is currently required to run the bot, but Python 3.6
-or higher is recommended.
+or higher is recommended. Python 3.5 support will be dropped with Python 8.
Pywikibot and this documentation are licensed under the
:ref:`MIT license`;
manual pages on mediawiki.org are licensed under the `CC-BY-SA 3.0`_ license.
-See also: `Pywikibot Manual`_ at https://www.mediawiki.org
+.. seealso:: `Pywikibot Manual`_ at https://www.mediawiki.org
Framework Modules Overview
--------------------------
.. image:: framework.png
+ :alt: Framework modules dependency network
For bot users:
@@ -41,7 +42,7 @@
:maxdepth: 1
installation
- utilities/index
+ utilities/scripts
scripts/index
global_options
faq
@@ -54,10 +55,8 @@
.. toctree::
:maxdepth: 1
- installation
library_usage
recipes
- getting_help
api_ref/index
For framework developers:
@@ -66,6 +65,7 @@
.. toctree::
:maxdepth: 1
+ utilities/scripts_ref
scripts_ref/scripts.maintenance
scripts_ref/index
diff --git a/docs/scripts/archive.rst b/docs/scripts/archive.rst
index f2a9ca6..70a929b 100644
--- a/docs/scripts/archive.rst
+++ b/docs/scripts/archive.rst
@@ -2,6 +2,7 @@
================
.. automodule:: scripts.archive
+.. seealso:: :ref:`Outdated scripts`
capitalize\_redirects script
----------------------------
diff --git a/docs/scripts/index.rst b/docs/scripts/index.rst
index 131fdb4..1f374ed 100644
--- a/docs/scripts/index.rst
+++ b/docs/scripts/index.rst
@@ -27,4 +27,5 @@
other
unsorted
maintenance
- archive
\ No newline at end of file
+ archive
+ outdated
\ No newline at end of file
diff --git a/docs/scripts/outdated.rst b/docs/scripts/outdated.rst
new file mode 100644
index 0000000..5729578
--- /dev/null
+++ b/docs/scripts/outdated.rst
@@ -0,0 +1,185 @@
+Outdated scripts
+================
+
+This list contains outdated scripts from :term:`compat` banch which
+haven't ported to the current :term:`core` branch of Pywikibot |version|.
+Feel free to reactivate any script at any time by creating a Phabricator
+task (:phab:`Porting request
+<maniphest/task/edit/form/1/?projects=pywikibot,pywikibot-scripts,Pywikibot-compat-to-core&title=Port
+Pywikibot%20compat%20script%20to%20core:%20>`)
+or reactivate the specified task below.
+
+.. seealso:: :ref:`Archived scripts`
+
+
+catimages script
+----------------
+
+**Image by content categorization** (:phab:`T66838)`
+
+Script to check uncategorized files. This script checks if a file
+has some content that allows to assign it to a category.
+
+
+censure script
+--------------
+
+**Bad word checker bot** (:phab:`T66839`)
+
+It checks new content for bad words and reports it on a log page.
+
+cfd script
+----------
+
+**This script processes the Categories for discussion working pag**
+
+It parses out the actions that need to be taken as a result of CFD
+discussions (as posted to the working page by an administrator) and
+performs them.
+
+
+commons\_category\_redirect script
+----------------------------------
+
+**Script to clean up non-empty catecory redirect category on Commons**
+
+Moves all images, pages and categories in redirect categories to the
+target category.
+
+
+copyright script
+----------------
+
+**This robot checks copyright violation** (:phab:`T66848`)
+
+Checks for text violating copyright by looking for matches in search
+engines.
+
+
+copyright\_clean script
+-----------------------
+**Script to remove on wiki pages reports of copyright.py** (:phab:`T66848`)
+
+
+copyright\_put script
+---------------------
+**Script to put reports of copyright.py to wiki page** (:phab:`T66848`)
+
+deledpimage script
+------------------
+**Script to remove EDP images in non-article namespaces** (:phab:`T66849`)
+
+Script hides images due to the Exemption Doctrine Policy in this way:
+
+* `[[Image:logo.jpg]]` --> `[[:Image:logo.jpg]]`
+* `[[:Image:logo.jpg]]` pass
+* `Image:logo.jpg` in gallery --> `[[:Image:logo.jpg]]` in gallery end
+* `logo.jpg` (like used in template) --> hide(used `<!--logo.jpg-->`)
+
+
+get script
+----------
+**Get a page and writes its contents to standard output**
+
+This makes it possible to pipe the text to another process.
+
+
+inline\_images script
+---------------------
+**Try to upload images which are linked inline** (:phab:`T66870`)
+
+This bot goes over multiple pages of the home wiki, and looks for
+images that are linked inline (i.e., they are hosted from an
+external server and hotlinked, instead of using the wiki's upload
+function) and uploads it form url.
+
+
+overcat\_simple\_filter script
+------------------------------
+
+**A bot to do some simple over categorization filtering** (:phab:`T66876`)
+
+
+panoramiopicker script
+----------------------
+**Script to copy a Panoramio set to image repository (Commons)**
+
+
+spellcheck script
+-----------------
+**This bot spellchecks wiki pages.** (:phab:`T236642`)
+
+The script is checking whether a word, stripped to its 'essence' is in
+a given list or not. It does not do any grammar checking or such.
+For each unknown word, you get a couple of options::
+
+ numbered options: replace by known alternatives
+ a: This word is correct; add it to the list of known words
+ c: The uncapitalized form of this word is correct; add it
+ i: Do not edit this word, but do also not add it to the list
+ p: Do not edit this word, and consider it correct for this page only
+ r: Replace the word, and add the replacement as a known alternative
+ s: Replace the word, but do not add the replacement
+ *: Edit the page using the gui
+ g: Give a list of 'guessed' words, which are similar to the given one
+ x: Ignore this word, and do not check the rest of the page
+
+When the bot is ended, it will save the extensions to its word list;
+there is one word list for each language.
+
+The bot does not rely on Latin script, but does rely on Latin punctuation.
+It is therefore expected to work on for example Russian and Korean, but not
+on for example Japanese.
+
+
+splitwarning script
+-------------------
+**Splits a interwiki.log file into chunks of warnings separated by language**
+
+
+standardize\_notes script
+-------------------------
+
+**This bot will standardize footnote references**
+
+
+statistics\_in\_wikitable script
+--------------------------------
+
+**This bot renders siteinfo statistics in a table on a wiki page.**
+
+Thus it creates and updates a Statistics wikitable.
+
+
+subster script
+--------------
+
+**Script which will does substitutions of tags within wiki page content**
+
+Robot which will does substitutions of tags within wiki page content with
+external or other wiki text data. Like dynamic text updating.
+
+
+tag\_nowcommons script
+----------------------
+
+**This script tags files available at Commons with the Nowcommons template**
+(:phab:`66159`)
+
+
+us\_states script
+-----------------
+**Check pages on the whether they are in common form**
+
+On English Wikipedia the common form is like `Something, State`
+and if so, create a redirect from `Something, ST`.
+
+
+warnfile script
+---------------
+
+**Script creates backlinks from a log file**
+
+A robot to implement backlinks from a interwiki.log file without checking
+them against the live wikipedia.
+
diff --git a/docs/utilities/index.rst b/docs/utilities/scripts.rst
similarity index 78%
copy from docs/utilities/index.rst
copy to docs/utilities/scripts.rst
index df39e86..71b096f 100644
--- a/docs/utilities/index.rst
+++ b/docs/utilities/scripts.rst
@@ -1,29 +1,35 @@
-.. _utility_scripts:
-
Utility scripts
===============
+.. automodule:: pywikibot.scripts
+ :no-members:
+
pwb wrapper script
------------------
.. automodule:: pwb
+ :no-members:
generate\_family\_file script
-----------------------------
.. automodule:: pywikibot.scripts.generate_family_file
+ :no-members:
generate\_user\_files script
----------------------------
.. automodule:: pywikibot.scripts.generate_user_files
+ :no-members:
shell script
------------
.. automodule:: pywikibot.scripts.shell
+ :no-members:
version script
--------------
.. automodule:: pywikibot.scripts.version
+ :no-members:
diff --git a/docs/utilities/index.rst b/docs/utilities/scripts_ref.rst
similarity index 89%
rename from docs/utilities/index.rst
rename to docs/utilities/scripts_ref.rst
index df39e86..253e8ca 100644
--- a/docs/utilities/index.rst
+++ b/docs/utilities/scripts_ref.rst
@@ -1,8 +1,9 @@
-.. _utility_scripts:
-
Utility scripts
===============
+.. automodule:: pywikibot.scripts
+ :private-members:
+
pwb wrapper script
------------------
diff --git a/pwb.py b/pwb.py
index 15715fe..5fa8c9a 100755
--- a/pwb.py
+++ b/pwb.py
@@ -6,7 +6,7 @@
1. Scripts listed in `user_script_paths` list inside your `user-config.py`
settings file in the given order. Refer
- :ref:`External Script Path Settings<external-script-path-settings>`.
+ :ref:`External Script Path Settings`.
2. User scripts residing in `scripts/userscripts` (directory mode only).
3. Scripts residing in `scripts` folder (directory mode only).
4. Maintenance scripts residing in `scripts/maintenance` (directory mode only).
diff --git a/pywikibot/page/_filepage.py b/pywikibot/page/_filepage.py
index 5c43c89..6f074ce 100644
--- a/pywikibot/page/_filepage.py
+++ b/pywikibot/page/_filepage.py
@@ -182,6 +182,7 @@
:meth:`APISite.imageusage()
<pywikibot.site._generators.GeneratorsMixin.imageusage>`
+ .. seealso:: :meth:`globalusage`
.. versionchanged:: 7.2
all parameters from :meth:`APISite.imageusage()
<pywikibot.site._generators.GeneratorsMixin.imageusage>`
@@ -289,6 +290,8 @@
"""
Iterate all global usage for this page.
+ .. seealso:: :meth:`usingPages`
+
:param total: iterate no more than this number of pages in total
:return: a generator that yields Pages also on sites different from
self.site.
diff --git a/pywikibot/scripts/__init__.py b/pywikibot/scripts/__init__.py
index 03090c6..fca31b6 100644
--- a/pywikibot/scripts/__init__.py
+++ b/pywikibot/scripts/__init__.py
@@ -8,7 +8,7 @@
from os import environ, getenv
-def _import_with_no_user_config(*import_args: str):
+def _import_with_no_user_config(*import_args):
"""Return __import__(*import_args) without loading user-config.py.
.. versionadded:: 3.0
diff --git a/pywikibot/scripts/shell.py b/pywikibot/scripts/shell.py
index 46cdb3f..075fbf1 100755
--- a/pywikibot/scripts/shell.py
+++ b/pywikibot/scripts/shell.py
@@ -2,17 +2,15 @@
"""
Spawns an interactive Python shell and imports the pywikibot library.
-The following local option is supported:
+The following local option is supported::
--noimport Do not import the pywikibot library. All other arguments are
- ignored in this case.
+ -noimport Do not import the pywikibot library. All other arguments are
+ ignored in this case.
-Usage:
+Usage::
python pwb.py shell [args]
-If no arguments are given, the pywikibot library will not be loaded.
-
.. versionchanged:: 7.0
moved to pywikibot.scripts
"""
diff --git a/scripts/archive/__init__.py b/scripts/archive/__init__.py
index b87f80c..272826c 100644
--- a/scripts/archive/__init__.py
+++ b/scripts/archive/__init__.py
@@ -3,6 +3,7 @@
These scripts may be removed at any time without further warning.
Feel free to reactivate any script at any time by creating a Phabricator
-task:
-https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=pywikibot
+task: :phab:`Recovery request
+<maniphest/task/edit/form/1/?projects=pywikibot,pywikibot-scripts&title=Recover
+Pywikibot%20script:%20>`
"""
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/776324
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: I72a446f26fe9dcac0d4b7c3da98a03c211e9ab4d
Gerrit-Change-Number: 776324
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged