site_detect
— Classes for Detecting MediaWiki Sites#
Classes for detecting a MediaWiki site.
- class site_detect.MWSite(fromurl, **kwargs)[source]#
Bases:
object
Minimal wiki site class.
- Raises:
pywikibot.exceptions.ServerError – a server error occurred while loading the site
Timeout – a timeout occurred while loading the site
RuntimeError – Version not found or version less than 1.27
- property api: str | None#
Get api URL.
- property iwpath#
Get article path URL.
- property langs#
Build interwikimap.
- site_detect.check_response(response)[source]#
Raise ClientError or ServerError depending on http status.
Added in version 3.0.
Changed in version 7.0: Raise a generic
exceptions.ServerError
if http status code is not IANA-registered but unofficial codeChanged in version 8.1: Raise a
exceptions.ClientError
if status code is 4XX