Package Pyblio :: Package External :: Class IExternal
[hide private]
[frames] | no frames]

Class IExternal

source code

object --+
         |
        IExternal
Known Subclasses:
WOK.WOK, Citeseer.Citeseer

Interface for querying external databases.

This queries uses Twisted's deferred mechanism to handle asynchronous results. At most one query can run on a given IExternal object at a time.

Instance Methods [hide private]
 
__init__(self, db)
Create a new external query interface.
source code
 
count(self, query)
Return the number of matches for the specified query.
source code
 
search(self, query, maxhits=100)
Return the number of matches for the specified query and a ResultSet() with the records that have been retrieved (at most maxhits).
source code
 
cancel(self)
Cancel a pending query.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  schema = ''
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, db)
(Constructor)

source code 
Create a new external query interface.

Args:
  db: Pyblio.Store.Database

Overrides: object.__init__

count(self, query)

source code 
Return the number of matches for the specified query.

Args:
  query: string
Return:
  twisted.internet.defer.Deferred() -> int

search(self, query, maxhits=100)

source code 
Return the number of matches for the specified query and a
ResultSet() with the records that have been retrieved (at most
maxhits).

Args:
  query: string
  maxhit: integer
Return:
  (twisted.internet.defer.Deferred() -> int,
   Pyblio.Store.ResultSet)