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.

Return type:unicode

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

Load the database from the shelve fn.

  • 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: ...

RequestDatabase instance from the fn or newly created.

Return type: