Releases: lahwaacz/wiki-scripts
Release list
Version 1.5.1
Version 1.5
- Project structure refactoring:
- Added
pyproject.tomland modern tooling (ruff, mypy) - Added
.editorconfig
- Added
- Fixed issues reported by new linters
- Added type hints (PEP 484)
- Tests:
- Reimplemented pytest fixtures for local MediaWiki testing
- Added test dependencies:
pytest-docker,pytest-dotenv,pytest-httpx
ws.checkers:- Dropped obsolete "HTTPS Everywhere" list and implementation
- Switched from the
requestspackage tohttpx- New dependencies:
httpx-retries,truststore
- New dependencies:
- Switched from naive to timezone-aware
datetime.datetimeobjects
in the entire code base - Improved hierarchy of classes in the
ws.checkersmodule
Version 1.4
-
Replaced the third-party modules
ConfigArgParseandconfigfilewith
their built-in alternatives. See the merge request for details: #69 -
As a result, the configuration file format has changed. See Configuration for details on migrating your configuration.
-
The default value of the
--cookie-fileoption was removed, so it has to be
set explicitly in the configuration file for persistent authenticated session. -
The
--siteand--cache-diroptions were removed. -
ws.checkers.ExtlinkReplacements: fixed tests, fixed replacement of
Arch bug tracker links, added more replacements for Arch projects and other
cases. -
ws.checkers.ExtlinkStatusChecker:- refactored to take the URLs from the database and save the results there
- skip links to invalid or blacklisted domains, detect sites behind
CloudFlare protection
-
ws.checkers.ExtlinkStatusUpdater: new module which was split from
ws.checkers.ExtlinkStatusCheckerand contains the (updated) code
for updating the status of extlinks on wiki pages. -
ws.checkers.WikilinkChecker: fixed urldecoding of section anchors,
fixed race condition between the "Archive page" and "Broken section link"
flags, removed some old and unnecessary workarounds. -
Simplified
ws.utils.TLSAdapterusingssl_versioninstead of
ssl_options. -
Many bug fixes for the
ws.dbmodule and thecheckdb.pyscript. -
Migrated to SQLAlchemy 2.0:
https://docs.sqlalchemy.org/en/20/changelog/migration_20.html -
The
ws.dbmodule now requires SQLAlchemy withasynciosupport
and theasyncpgdriver for PostgreSQL. The synchronous interface with the
psycopg2driver is still used as well. -
ws.db.schema: added new tablesws_domainandws_url_check
for tracking the results of status checks for domains and URLs. -
New scripts:
delete-unused-categories.pylocalize-templates.pymark-archived-links.pyrace.pyreport-problems.py(previouslylist-problematic-pages.py, now it
also has an automatic report page)update-page-language.py
-
Refactored scripts:
-
extlink-checker.pyhas a new required parameter--modewith two
choices:checkusesws.checkers.ExtlinkStatusCheckerwhich takes
URLs from the database and checks their status, andupdateusesws.checkers.ExtlinkStatusUpdaterwhich takes
the check results from the database and applies them on the wiki.
-
Version 1.3
- SQL database:
- Implemented a subset of MediaWiki API querie. Lists:
allpages,
alldeletedrevisions,allrevisions,allusers,logevents,
protectedtitles,recentchanges; props:categories,
deletedrevisions,extlinks,images,info,iwlinks,
langlinks,linkshere,links,pageprops,redirects,
revisions,sections,templates,transcludedin; including
generator,titlesandpageidsparameters. See the GitHub
issue for more information:
#35. - Implemented synchronization of revisions contents (either full or just
the latest revision for each page). - Fixed many bugs in the synchronization process.
- Implemented custom parser cache, see the GitHub issue for more
information: #42
- Implemented a subset of MediaWiki API querie. Lists:
- Removed
ws.cache.LatestRevisionsmodule. Scripts use the SQL
database for caching. - Merged several smaller scripts into
list-problems.py. - Implemented the
ws.client.api.API.movemethod to rename pages on
the wiki. - Implemented recursive template expansion using
mwparserfromhelland
the SQL database. Seews.parser_helpers.template_expansion. - Implemented a regex-based function to check if a page is a redirect
(ws.parser_helpers.wikicode.is_redirect). - Fixed handling of relative links and leading colons in the
ws.parser_helpers.title.Titleclass. - The parameter
--ssl-verifyis removed, SSL certificates are always verified
for HTTPS requests. Furthermore, TLS 1.2 or newer is required for all HTTPS
requests. - And much more...
Version 1.2
- Large refactoring:
ws.corerenamed tows.client, createdws.utils,ws.statistics,ws.interlanguage - Added
ws.client.site,ws.client.userandws.client.redirectsmodules,ws.client.api.APIhas attributes with the appropriate instances for the current wiki. - Improved parsing of page titles - fixed many bugs, extended test suite, added checking of legal characters, handling of namespace aliases.
- Added
ws.autopagesubmodule. - Switched from
nosetopytestfor testing. - Added
ws.dbmodule for the synchronization of a remote wiki into a local PostgreSQL database. See the GitHub issue for more information: #35. This also means multiple new dependencies, see the README file for details. - Transparent automatic conversion of timestamp strings into the Python's
datetime.datetimeobjects. As a result, manual calls to thews.utils.parse_dateandws.utils.format_datefunctions should not be necessary when working with the API.
Version 1.1
- Fixed handling of
csrftoken, it is now cached and automatically renewed as
indicated by the server responses. - Partial interlanguage support for
update-package-templates.py: localized
templates "Broken package link" and "aur-mirror" are respected. - Added the
ws.parser_helpers.titlemodule for parsing titles into
(iwprefix, namespace, pagename, sectionname)and easy manipulation with
the parts. - Removed
ws.core.api.API.detect_namespace()in favour of the new
Title <ws.parser_helpers.title.Title>parser. - Improved exception logging in
API.edit() <ws.core.api.API.edit>.
Bothws.core.api.API.edit()and
ws.interactive.edit_interactive()now take an additionaltitle
parameter representing the title of the page being edited. - Added support for
WikEdDiff, an inline-style diff engine with
block move support and splitting optimized for MediaWiki markup.
pygmentsis now used only as a fallback. - The
link-checker.pyscript has been improved to consider the
DISPLAYTITLEproperty of pages and links to sections are checked base on
the sections existing on the target page. - Added
--connection-max-retriesand--connection-timeoutoptions. - Added
toc.pyscript to update the "Table of contents" page on the wiki.
Version 1.0
- Major reorganization of the project structure: common code shared between the
scripts has been moved to thewsmodule and the original
MediaWikimodule has been renamed tows.core, some of its
parts were moved directly tows. - Reorganization of the
ws.parser_helperssubmodule, added
ws.parser_helpers.encodings. - Expanded documentation, fixed many typos in docstrings.
- Expanded test suite, at least for parts not depending on the MediaWiki API.
- Generalized the
ws.core.connection.Connectionclass to handle also
theindex.phpentry point. - Created the
ws.core.lazy.LazyPropertydecorator and made
ws.core.api.API.is_loggedin,ws.core.api.API.user_rights
andws.core.api.API.namespacesproper properties. - Started using the
loggingmodule for messages. - New unified configuration interface for all scripts, using the
ws.configsubmodule. SeeConfiguration <configuration>_ for
details.- Basically all scripts were modified to use the
ws.config
interface. - Default cookie path was changed from
$XDG_CACHE_HOMEto
$XDG_CACHE_HOME/wiki-scripts. - Some command line arguments were renamed because of global configuration in
a config file.
- Basically all scripts were modified to use the
- Added also
assert=botto all bot editing queries. - Fixed bugs:
- formatting of streak timestamps in the
statistic.pyscript - namespace prefix parsing in
ws.core.api.API.detect_namespace - extraction of header elements in case they are nested inside e.g.
<noinclude>tags - whitespace squashing in the
ws.parser_helpers.wikicode.remove_and_squashfunction - query-continuation algorithm (used to fail with generator queries with
multiple values in thepropquery parameter) - JSON serialization of non-str keys
- exception catching for opening cookies
- formatting of streak timestamps in the
- Improved scripts:
statistics.py(minor bug fixes)update-interlanguage-links.py(heavy refactoring)check-user-namespace.py(warn if user pages are categorized)list-redirects-broken-fragments.py(improved detection of redirects with
broken fragments by comparing dot-encoded fragments)dump.py(deduplicated againstws.core.connection.Connection)
- New scripts:
recategorize-over-redirect.py