Package telemeta :: Package interop :: Module oai :: Class Response
[hide private]
[frames] | no frames]

Class Response

source code

object --+
         |
        Response

OAI-PMH response generation

Instance Methods [hide private]
 
__init__(self, identity, datasource)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
append_elements(self, parent, elements, prefix=None)
Append several elements to parent.
source code
 
set_attributes(self, element, attributes)
Set several attributes on element, from dict.
source code
 
set_verb(self, verb)
Set the verb of the response.
source code
 
identify(self)
Append Identify tag and child nodes
source code
 
error(self, code, msg=None)
Add error tag using code.
source code
 
make_record_header(self, id, ctime)
Build and return a record header
source code
 
make_record(self, id, dc, ctime)
Build and return a record
source code
 
parse_dc(self, data) source code
 
get_record(self, id)
Append GetRecord result
source code
 
list_records(self, from_time, until_time, token=None, ids_only=False)
Append ListIdentifiers or ListRecords result
source code
 
list_formats(self, id=None)
Append ListMetadataFormats result
source code
 
free(self)
Free the resources used by this response
source code

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

Class Variables [hide private]
  max_records_per_response = 500
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, identity, datasource)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

append_elements(self, parent, elements, prefix=None)

source code 

Append several elements to parent. elements must either be a tag:value dict or an ordered list of (tag, value) tuples.

set_attributes(self, element, attributes)

source code 

Set several attributes on element, from dict. attributes must either be an attr:value dict or an ordered list of (attr, value) tuples. If element is a string, then create an element with than name. Return (possibly created) element.

set_verb(self, verb)

source code 

Set the verb of the response. Should be called before any 'real' method such as identify(), get_record(), etc...

error(self, code, msg=None)

source code 

Add error tag using code. If msg is not provided, use a default error message.