Cheetah.Tools.MondoReport module — Cheetah3 - The Python-Powered Template Engine

# Cheetah.Tools.MondoReport module

@@TR: This code is pretty much unsupported.

MondoReport.py – Batching module for Python and Cheetah.

Version 2001-Nov-18. Doesn’t do much practical yet, but the companion testMondoReport.py passes all its tests. -Mike Orr (Iron)

TODO: BatchRecord.prev/next/prev_batches/next_batches/query, prev.query, next.query.

How about Report: .page(), .all(), .summary()? Or PageBreaker.

class Cheetah.Tools.MondoReport.IndexFormats(index, item=None)

  Bases: `object`

  Eight ways to display a subscript index. (“Fifty ways to leave your lover….”)

  Letter()
  Roman()
  even()
  even_i()
  index()
  item()
  letter()
  number()
  odd()
  odd_i()
  roman()

class Cheetah.Tools.MondoReport.MondoReport(origlist)

  Bases: `object`

  all()
  batch(size, start, overlap=0, orphan=0)

    Returns list of ($r, $a, $b)

  page(size, start, overlap=0, orphan=0)

    Returns list of ($r, $a, $b)

  summary()

exception Cheetah.Tools.MondoReport.NegativeError

  Bases: `ValueError`

class Cheetah.Tools.MondoReport.PrevNextPage(origList, size, start)

  Bases: `object`

class Cheetah.Tools.MondoReport.RecordStats(origList, index)

  Bases: `IndexFormats`, `ValuesGetterMixin`

  The statistics that depend on the current record.

  first()
  firstValue(field=None)
  last()
  lastValue(field=None)
  length()
  next()
  nextPages()
  next_batches()
  percentOfTotal(field=None, suffix='%', default='N/A', decimals=2)
  prev()
  prevPages()
  prev_batches()
  summary()

Cheetah.Tools.MondoReport.Roman(n)

class Cheetah.Tools.MondoReport.Summary(origList)

  Bases: `ValuesGetterMixin`

  The summary statistics, that don’t depend on the current record.

  average(field=None)

    Always returns a floating point number.

  count(field=None)
  max(field=None)
  mean(field=None)

    Always returns a floating point number.

  median(field=None)
  min(field=None)
  standardDeviation(field=None)
  standardDeviation_n(field=None)
  sum(field=None)
  total(field=None)
  variance(field=None)
  variance_n(field=None)

class Cheetah.Tools.MondoReport.ValuesGetterMixin(origList)

  Bases: `object`

Cheetah.Tools.MondoReport.isNonNegative(v)

Cheetah.Tools.MondoReport.isNotNone(v)

Cheetah.Tools.MondoReport.isNumeric(v)

Cheetah.Tools.MondoReport.mean(lis)

  Always returns a floating-point number.

Cheetah.Tools.MondoReport.median(lis)

Cheetah.Tools.MondoReport.standardDeviation(lis)

Cheetah.Tools.MondoReport.standardDeviation_n(lis)

Cheetah.Tools.MondoReport.sum(lis)

Cheetah.Tools.MondoReport.variance(lis)

Cheetah.Tools.MondoReport.variance_n(lis)