Package pywikipedia :: Module interwiki :: Class Subject
[show private | hide private]
[frames | no frames]

Type Subject

object --+
         |
        Subject


Class to follow the progress of a single 'subject' (i.e. a page with all its translations)
Method Summary
  __init__(self, pl, hints)
Constructor.
  assemble(self)
  conditionalAdd(self, pl, counter, foundin)
Add the pagelink given to the todo list, but only if we didn't know it before.
  finish(self, sa)
Round up the subject, making any necessary changes.
  isDone(self)
Return True if all the work for this subject has completed.
  openSites(self)
Return a list of sites for all things we still need to do
  pl(self)
Return the Page on the home wiki
  problem(self, txt)
Report a problem with the resolution of this subject.
  reportBacklinks(self, new)
Report missing back links.
  translate(self, hints)
Add the translation hints given to the todo list
  whereReport(self, pl, indent)
  willWorkOn(self, site)
By calling this method, you 'promise' this instance that you will work on any todo items for the wiki indicated by 'site'.
  workDone(self, counter)
This is called by a worker to tell us that the promised work was completed as far as possible.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Method Details

__init__(self, pl, hints=None)
(Constructor)

Constructor. Takes as arguments the Page on the home wiki plus optionally a list of hints for translation
Overrides:
__builtin__.object.__init__

conditionalAdd(self, pl, counter, foundin)

Add the pagelink given to the todo list, but only if we didn't know it before. If it is added, update the counter accordingly.

finish(self, sa=None)

Round up the subject, making any necessary changes. This method should be called exactly once after the todo list has gone empty.

This contains a shortcut: if a subject array is given in the argument sa, just before submitting a page change to the live wiki it is checked whether we will have to wait. If that is the case, the sa will be told to make another get request first.

isDone(self)

Return True if all the work for this subject has completed.

openSites(self)

Return a list of sites for all things we still need to do

pl(self)

Return the Page on the home wiki

problem(self, txt)

Report a problem with the resolution of this subject.

reportBacklinks(self, new)

Report missing back links. This will be called from finish() if needed.

translate(self, hints=None)

Add the translation hints given to the todo list

willWorkOn(self, site)

By calling this method, you 'promise' this instance that you will work on any todo items for the wiki indicated by 'site'. This routine will return a list of pages that can be treated.

workDone(self, counter)

This is called by a worker to tell us that the promised work was completed as far as possible. The only argument is an instance of a counter class, that has methods minus() and plus() to keep counts of the total work todo.

Generated by Epydoc 2.1 on Sun Jul 03 17:07:38 2005 http://epydoc.sf.net