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

Type SubjectArray

object --+
         |
        SubjectArray


A class keeping track of a list of subjects, controlling which pages are queried from which languages when.
Method Summary
  __init__(self)
Constructor.
  __len__(self)
  add(self, pl, hints)
Add a single subject to the list
  dump(self, fn)
  firstSubject(self)
Return the first subject that is still being worked on
  generateMore(self, number)
Generate more subjects.
  isDone(self)
Check whether there is still more work to do
  maxOpenSite(self)
Return the site that has the most open queries plus the number.
  minus(self, site)
This is a routine that the Subject class expects in a counter
  oneQuery(self)
Perform one step in the solution process
  plus(self, site)
This is a routine that the Subject class expects in a counter
  queryStep(self)
  run(self)
Start the process until finished
  selectQuerySite(self)
Select the site the next query should go out for.
  setGenerator(self, generator)
Add a generator of subjects.
    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)
(Constructor)

Constructor. We always start with empty lists.
Overrides:
__builtin__.object.__init__

add(self, pl, hints=None)

Add a single subject to the list

firstSubject(self)

Return the first subject that is still being worked on

generateMore(self, number)

Generate more subjects. This is called internally when the list of subjects becomes to small, but only if there is a generator

isDone(self)

Check whether there is still more work to do

maxOpenSite(self)

Return the site that has the most open queries plus the number. If there is nothing left, return None, 0. Only languages that are TODO for the first Subject are returned.

minus(self, site)

This is a routine that the Subject class expects in a counter

oneQuery(self)

Perform one step in the solution process

plus(self, site)

This is a routine that the Subject class expects in a counter

run(self)

Start the process until finished

selectQuerySite(self)

Select the site the next query should go out for.

setGenerator(self, generator)

Add a generator of subjects. Once the list of subjects gets too small, this generator is called to produce more Pages

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