Package intermine :: Module results :: Class JSONIterator
[hide private]
[frames] | no frames]

Class JSONIterator

source code

object --+
         |
        JSONIterator

An iterator for handling results returned in the JSONRows format

This iterator can be used as the sub iterator in a ResultIterator

Instance Methods [hide private]
 
__init__(self, connection, parser) source code
 
__iter__(self) source code
 
next(self)
Returns a parsed row of data
source code
 
parse_header(self)
Reads out the header information from the connection
source code
 
check_return_status(self)
The footer containts information as to whether the result set was successfully transferred in its entirety.
source code
 
get_next_row_from_connection(self)
Reads the connection to get the next row, and sends it to the parser
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, connection, parser)
(Constructor)

source code 

Constructor

Parameters:
  • connection (socket.socket) - The source of data
  • parser (Parser) - a handler for each row of data
Overrides: object.__init__

check_return_status(self)

source code 

Perform status checks

The footer containts information as to whether the result set was successfully transferred in its entirety. This method makes sure we don't silently accept an incomplete result set.

Raises:

get_next_row_from_connection(self)

source code 

Reads the connection to get the next row, and sends it to the parser

Raises: