Home | Trees | Index | Help |
|
---|
Package pywikipedia :: Module wikipedia :: Class Page |
|
object
--+
|
Page
_Category
Method Summary | |
---|---|
Constructor. | |
Pseudo method to be able to use equality and inequality tests on Page objects | |
Pseudo method that makes it possible to store Page objects as keys in hash-tables. | |
A more complete string representation | |
A console representation of the pagelink | |
A string representation in the form of a link. | |
A list of categories that the article is in. | |
The name of the page without the namespace part. | |
Returns a set of all user names (including anonymous IPs) of those who edited the page. | |
Deletes the page from the wiki. | |
Returns the character encoding used on this page's wiki. | |
True if the page exists (itself or as redirect), False if not | |
The wiki-text of the page. | |
If the page is a redirect page, gives the title of the page it redirects to. | |
Returns a list of pages that link to the page. | |
Loads the version history page and returns a list of tuples, where each tuple represents one edit and is built of edit date/time, user name, and edit summary. | |
Gives the wiki-images the page shows, as a list of pagelink objects | |
A list of interwiki links in the page. | |
True if the page is a Category, false otherwise. | |
isDisambig(self)
| |
True if the page except for language links and category links has less than 4 characters, False otherwise. | |
True if the page is an Image description page, false otherwise. | |
True if the page is a redirect page, False if not or not existing | |
Gives the normal (not-interwiki, non-category) pages the page links to, as a list of Page objects | |
The name of the page this Page refers to, in a form suitable for a wiki-link | |
Gives the number of the namespace of the page. | |
Replace the new page with the contents of the first argument. | |
Just like categories, but gives the categories including the part after the |, if any. | |
The name of the section this Page refers to. | |
sectionFreeLinkname(self,
doublex)
| |
The site of the page this Page refers to, without : | |
Gives a list of template names used on a page (strings). | |
The name of the page this Page refers to, in a form suitable for the URL of the page. | |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value |
Method Details |
---|
__init__(self,
site,
title=None,
insite=None,
tosite=None)
|
__cmp__(self,
other)
Pseudo method to be able to use equality and inequality tests on
Page objects
|
__hash__(self)
Pseudo method that makes it possible to store Page objects as keys
in hash-tables. This relies on the fact that the string representation
of an instance can not change after the construction.
|
__repr__(self)
A more complete string representation
|
__str__(self)
A console representation of the pagelink
|
aslink(self, forceInterwiki=False)A string representation in the form of a link. The link will be an interwiki link if needed. If you set forceInterwiki to True, the link will have the format of an interwiki link even if it points to the home wiki. Note that the family is never included. |
categories(self)A list of categories that the article is in. This will retrieve the page text to do its work, so it can raise the same exceptions that are raised by the get() method. The return value is a list of Page objects for each of the category links in the page text. |
catname(self, doublex=False)The name of the page without the namespace part. Gives an error if the page is from the main namespace. Note that this is a raw way of doing things - it simply looks for a : in the name. |
contributingUsers(self)Returns a set of all user names (including anonymous IPs) of those who edited the page. |
delete(pl, reason=None, prompt=True)Deletes the page from the wiki. Requires administrator status. If reason is None, asks for a reason. If prompt is True, asks the user if he wants to delete the page. |
encoding(self)Returns the character encoding used on this page's wiki. |
exists(self)True if the page exists (itself or as redirect), False if not |
get(self, read_only=False, force=False, get_redirect=False, throttle=True)The wiki-text of the page. This will retrieve the page if it has not been retrieved yet. This can raise the following exceptions that should be caught by the calling code: NoPage: The page does not exist IsRedirectPage: The page is a redirect. The argument of the exception is the page it redirects to. LockedPage: The page is locked, and therefore it won't be possible to change the page. This exception won't be raised if the argument read_only is True. SectionError: The subject does not exist on a page with a # link |
getRedirectTarget(self, read_only=False)If the page is a redirect page, gives the title of the page it redirects to. Otherwise it will raise an IsNotRedirectPage exception. This function can raise a NoPage exception, and unless the argument read_only is True, a LockedPage exception as well. |
getReferences(self, follow_redirects=True)Returns a list of pages that link to the page. If follow_redirects is True, also returns pages that link to a redirect pointing to the page. |
getVersionHistory(self, forceReload=False)Loads the version history page and returns a list of tuples, where each tuple represents one edit and is built of edit date/time, user name, and edit summary. |
imagelinks(self)Gives the wiki-images the page shows, as a list of pagelink objects |
interwiki(self)A list of interwiki links in the page. This will retrieve the page text to do its work, so it can raise the same exceptions that are raised by the get() method. The return value is a list of Page objects for each of the interwiki links in the page text. |
isCategory(self)True if the page is a Category, false otherwise. |
isEmpty(self)True if the page except for language links and category links has less than 4 characters, False otherwise. Can return the same exceptions as get() |
isImage(self)True if the page is an Image description page, false otherwise. |
isRedirectPage(self)True if the page is a redirect page, False if not or not existing |
linkedPages(self)Gives the normal (not-interwiki, non-category) pages the page links to, as a list of Page objects |
linkname(self, doublex=False)The name of the page this Page refers to, in a form suitable for a wiki-link |
namespace(self)Gives the number of the namespace of the page. Does not work for all namespaces in all languages, only when defined in family.py. If not defined, it will return 0 (the main namespace) |
put(self, newtext, comment=None, watchArticle=None, minorEdit=True)Replace the new page with the contents of the first argument. The second argument is a string that is to be used as the summary for the modification If watchArticle is None, leaves the watchlist status unchanged. |
rawcategories(self)Just like categories, but gives the categories including the part after the |, if any. Of course these will thus be pagelinks to non-existing pages, but as long as we just use linkname() and such, that won't matter. |
section(self)The name of the section this Page refers to. Sections are denominated by a # in the linkname(). If no section is referenced, None is returned. |
site(self)The site of the page this Page refers to, without : |
templates(self)Gives a list of template names used on a page (strings). |
urlname(self)The name of the page this Page refers to, in a form suitable for the URL of the page. |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Sun Jul 03 17:07:36 2005 | http://epydoc.sf.net |