Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
proc
/
thread-self
/
root
/
usr
/
lib
/
python2.7
/
site-packages
/
boto
/
sdb
/
db
/
File Content:
sequence.pyo
� �Wc @ s� d d l m Z d d l m Z d e f d � � YZ d d d � Z d d d � Z d d d � Z e d � Z d e f d � � YZ d S( i����( t SDBResponseError( t sixt SequenceGeneratorc B s5 e Z d Z d Z e d � Z d d � Z d � Z RS( s� Generic Sequence Generator object, this takes a single string as the "sequence" and uses that to figure out what the next value in a string is. For example if you give "ABC" and pass in "A" it will give you "B", and if you give it "C" it will give you "AA". If you set "rollover" to True in the above example, passing in "C" would give you "A" again. The Sequence string can be a string or any iterable that has the "index" function and is indexable. R c C sO | | _ t | d � | _ | | _ | d | _ d | j j | f | _ d S( s� Create a new SequenceGenerator using the sequence_string as how to generate the next item. :param sequence_string: The string or list that explains how to generate the next item in the sequence :type sequence_string: str,iterable :param rollover: Rollover instead of incrementing when we hit the end of the sequence :type rollover: bool i i����s %s('%s')N( t sequence_stringt lent sequence_lengtht rollovert last_itemt __class__t __name__( t selfR R ( ( s8 /usr/lib/python2.7/site-packages/boto/sdb/db/sequence.pyt __init__( s c C s� | d k s! t | � | j k r, | j d S| | j } | j r} | | j k r} d | | | j � | j | � f } n! d | | j | j | � f } | S( s"