request_database submodule

This module is used to keep incomming and outgoing structures and also for serialization/deserialization to/from XML.

Bases: aleph_link_export.shelvedb.ShelveDatabase

Keep the track of requests and resposes and their serialization and deserialization from/to XMl.

Path to the request XML.

Path to the response XML

Add new request object to database.

Parameters:request (obj) – Object with defined session_id property and to_dict_xml() method.

Process response queue, remove finished requests from request queue, return list of response objects.

Returns:List of LinkUpdateResponse objects.
Return type:list

Convert _req_queue to XML as defined in request XSD.

Returns:XML.
Return type:unicode

Read the response XML, process it, save the database and request XML.

Load the database from the shelve fn.

Parameters:
  • fn (str) – Path to the database file. Default DATABASE_FN.
  • db_key (str) – What database key to use. Default DATABASE_KEY.
  • creator (fn reference) – Reference to the function, which will create new RequestDatabase if the old is not found. Default lambda, which expects fn parameter lambda fn: ...
Returns:

RequestDatabase instance from the fn or newly

created.

Return type:

obj