/usr/lib/python2.6/site-packages/boto/sdb/db
NameSizeModeActions
manager/-0755rm
blob.py24370644editdlrm
blob.pyc25290644editdlrm
blob.pyo25290644editdlrm
key.py20360644editdlrm
key.pyc23420644editdlrm
key.pyo23420644editdlrm
model.py101580644editdlrm
model.pyc117230644editdlrm
model.pyo114660644editdlrm
property.py250860644editdlrm
property.pyc292840644editdlrm
property.pyo292840644editdlrm
query.py30720644editdlrm
query.pyc32570644editdlrm
query.pyo32570644editdlrm
sequence.py82230644editdlrm
sequence.pyc80440644editdlrm
sequence.pyo79890644editdlrm
test_db.py54270644editdlrm
test_db.pyc85690644editdlrm
test_db.pyo79610644editdlrm
__init__.py11080644editdlrm
__init__.pyc1430644editdlrm
__init__.pyo1430644editdlrm
Edit: /usr/lib/python2.6/site-packages/boto/sdb/db/sequence.pyo (7989B)
Ñò Å-õSc@s‰ddklZddklZdefd„ƒYZd d d„Zd d d„Zddd „Z ed ƒZ d efd „ƒYZ d S(iÿÿÿÿ(tSDBResponseError(tsixtSequenceGeneratorcBs5eZdZdZed„Zdd„Zd„ZRS(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. RcCsO||_t|dƒ|_||_|d|_d|ii|f|_dS(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 iiÿÿÿÿs%s('%s')N(tsequence_stringtlentsequence_lengthtrollovert last_itemt __class__t__name__(tselfRR((s8/usr/lib/python2.6/site-packages/boto/sdb/db/sequence.pyt__init__(s   cCs¨|djpt|ƒ|ijo |idS||i }|i o;||ijo+d|||i ƒ|i|ƒf}n"d||i |i|ƒf}|S(s"Get the next value in the sequenceis%s%sN(tNoneRRRRRt_inc(R tvaltlastt last_value((s8/usr/lib/python2.6/site-packages/boto/sdb/db/sequence.pyt__call__:s# +!cCs(|i|ii|ƒdt|iƒS(sIncrement a single valuei(RtindexR(R R((s8/usr/lib/python2.6/site-packages/boto/sdb/db/sequence.pyR HsN(R t __module__t__doc__tFalseR R RR (((s8/usr/lib/python2.6/site-packages/boto/sdb/db/sequence.pyRs    cCs|djodS|dS(Nii(R (tcvtlv((s8/usr/lib/python2.6/site-packages/boto/sdb/db/sequence.pytincrement_by_oneQs cCs|djodS|dS(Nii(R (RR((s8/usr/lib/python2.6/site-packages/boto/sdb/db/sequence.pytdoubleVs iicCs6|djo d}n|djo d}n||S(s@The fibonacci sequence, this incrementer uses the last valueiiN(R (RR((s8/usr/lib/python2.6/site-packages/boto/sdb/db/sequence.pytfib[s     tABCDEFGHIJKLMNOPQRSTUVWXYZtSequencecBsteZdZddedd„Zd„Zd„ZeeeƒZ d„Z d„Z ee ƒZ d„Z d„ZRS( s¾A simple Sequence using the new SDB "Consistent" features Based largly off of the "Counter" example from mitch garnaat: http://bitbucket.org/mitch/stupidbototricks/src/tip/counter.pycCsôd|_d|_d|_||_||_|djo||ƒ}n|idjo%ddk}t|iƒƒ|_nt |dƒƒ|_ d|_ t |t iƒo ddkl}||ƒ}n||_|ip ||_ndS(snCreate a new Sequence, using an optional function to increment to the next number, by default we just increment by one. Every parameter here is optional, if you don't specify any options then you'll get a new SequenceGenerator with a random ID stored in the default domain that increments by one and uses the default botoweb environment :param id: Optional ID (name) for this counter :type id: str :param domain_name: Optional domain name to use, by default we get this out of the environment configuration :type domain_name:str :param fnc: Optional function to use for the incrementation, by default we just increment by one There are several functions defined in this module. Your function must accept "None" to get the initial value :type fnc: function, str :param init_val: Initial value, by default this is the first element in your sequence, but you can pass in any value, even a string if you pass in a function that uses strings instead of ints to increment iÿÿÿÿN(t find_class(R t_dbt_valueRt domain_nametidtuuidtstrtuuid4ttypet item_typet timestampt isinstanceRt string_typest boto.utilsRtfncR(R R!R R+tinit_valR"R((s8/usr/lib/python2.6/site-packages/boto/sdb/db/sequence.pyR ls$          c CsÚddk}|iƒ}g}h}||d<|idj o&|i|ds8