-
Notifications
You must be signed in to change notification settings - Fork 51
page
page.py is a module that contains classes and functions for working with pages on wikis.
page.py defines 1 object
A Page object represents a page on the wiki. It contains information on the title and namespace and can be used to retrieve information about it such as the page content and categories. See page.Page for complete documentation and examples.
page.py defines 5 exceptions
BadTitle is a subclass of wiki.WikiError and is raised when trying to create a Page with an invalid title. See MW Docs for more information.
NoPage is a subclass of wiki.WikiError and is raised when calling certain functions of the Page object when the page doesn't exist on the wiki, such as trying to get the links or wikitext of a non-existent page.
BadNamespace is a subclass of wiki.WikiError and is raised when trying to set a namespace number that doesn't exist on the wiki
EditError is a subclass of wiki.WikiError and is raised when an invalid combination of parameters is passed to Page.edit()
ProtectError is a subclass of wiki.WikiError and is raised when when an invalid combination of parameters is passed to Page.protect()
namespaceDetect(title, site)
Given a page title and a wiki object, determines the namespace without needing to do any API queries. Returns the integer corresponding to the namespace.