pyrax
Python Bindings for the Rackspace Cloud
 All Classes Namespaces Files Functions Variables Properties
Public Member Functions | Public Attributes
ResultsIterator Class Reference

This object will iterate over all the results for a given type of listing, no matter how many items exist. More...

Inheritance diagram for ResultsIterator:
FakeIterator StorageObjectIterator

List of all members.

Public Member Functions

def __init__
def __iter__
def next
 Return the next available item.

Public Attributes

 manager
 marker
 limit
 results
 list_method
 marker_att
 extra_args
 next_uri

Detailed Description

This object will iterate over all the results for a given type of listing, no matter how many items exist.

This is an abstract class; subclasses must define the _init_methods() method to specify what manager method should be called to get the next batch of results. Both the equivalent of 'list()' and '_list()' may be specified You may also specify any extra args to be sent when this method is called.

By default the marker will be unspecified, and the limit will be 1000. You can override either by specifying them during instantiation.

The 'kwargs' will be converted to attributes. E.g., in this call: rit = ResultsIterator(mgr, foo="bar") will result in the object having a 'foo' attribute with the value of 'bar'.


Constructor & Destructor Documentation

def __init__ (   self,
  manager,
  marker = None,
  limit = 1000,
  kwargs 
)

Member Function Documentation

def __iter__ (   self)
def next (   self)

Return the next available item.

If there are no more items in the local 'results' list, check if there is a 'next_uri' value. If so, use that to get the next page of results from the API, and return the first item from that query.


Member Data Documentation

Reimplemented in StorageObjectIterator.

Reimplemented in StorageObjectIterator.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Properties