Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #266 (closed defect: fixed)

Opened 13 years ago

Last modified 12 years ago

[PATCH] Add cycle to stdvars

Reported by: KarlGuertin Owned by: anonymous
Priority: low Milestone: 0.9
Component: Kid Version:
Severity: trivial Keywords:


It's fairly common to want to cycle through a set of values when creating a page (usually for alternating rows). Rather than go through one of the various  KidRecipes that have caveats, simply provide a default cycle object.

This is basically itertools.cycle that's been wrapped so that it can save it's current value. Simple, but it will make your designers happy (or at least this one).


Change History

comment:1 Changed 13 years ago by kevin

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone changed from 1.0 to 0.9

I've added this in [389]. Bob Ippolito had a good point about potential confusion between this and the native itertools cycle. However, this functions basically the same, just with the added ability to query the current value.

Thanks for the patch!

Note: See TracTickets for help on using tickets.