Module Expr Str ImportFrom alias ImportFrom alias Import alias ImportFrom alias Assign NameStore ListLoad Str Str Str Str Str Str Str Str Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return IfExp Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad BinOpMod Str TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args defaults vararg kwarg body Expr Str Assign NameStore BinOpAdd Call NameLoad Call NameLoad NameLoad NameLoad ListComp NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Return NameLoad Return Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call NameLoad keyword CompareEq NameLoad Num keyword CompareEq NameLoad BinOpSub Call NameLoad NameLoad Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore ListLoad For NameStore NameLoad body Assign NameStore BoolOpAnd NameLoad UnaryOpNot Call NameLoad NameLoad If BoolOpAnd NameLoad NameLoad body AugAssignAdd NameStore BinOpMult ListLoad NameLoad BinOpSub NameLoad Call NameLoad NameLoad Expr Yield Call NameLoad NameLoad Delete SubscriptDel NameLoad Slice Expr Call AttributeLoad NameLoad attr NameLoad If BoolOpOr NameLoad CompareEq Call NameLoad NameLoad NameLoad body Expr Yield Call NameLoad NameLoad Delete SubscriptDel NameLoad Slice If NameLoad body AugAssignAdd NameStore BinOpMult ListLoad NameLoad BinOpSub NameLoad Call NameLoad NameLoad Expr Yield Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str ImportFrom alias Return BoolOpAnd Call NameLoad NameLoad NameLoad UnaryOpNot Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareEq NameLoad Num body Assign NameStore Num orelse Assign NameStore Call NameLoad Call NameLoad BinOpDiv Call NameLoad NameLoad NameLoad Return TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num Num body Expr Str If UnaryOpNot NameLoad body Assign NameStore Num Assign NameStore BinOpMult NameLoad NameLoad Assign NameStore BinOpAdd NameLoad NameLoad Assign NameStore NameLoad If Call NameLoad NameLoad Str body Assign NameStore Call NameLoad NameLoad If BoolOpAnd NameLoad CompareGtE NameLoad NameLoad body ImportFrom alias Raise Call NameLoad Call NameLoad Str keyword NameLoad TryExcept body Assign NameStore SubscriptLoad NameLoad Slice NameLoad NameLoad handlers ExceptHandler type NameLoad body Assign NameStore ListLoad Assign NameStore Num For TupleStore NameStore NameStore Call NameLoad NameLoad body If CompareLtELt NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If BoolOpAnd CompareIsNot NameLoad NameLoad CompareGtE NameLoad NameLoad body Break If CompareIs NameLoad NameLoad body Assign NameStore BinOpAdd NameLoad Num Return TupleLoad NameLoad NameLoad Call NameLoad Call NameLoad BinOpDiv Call NameLoad NameLoad NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Num Num NameLoad body If UnaryOpNot NameLoad body Assign NameStore Num If CompareIs NameLoad NameLoad body Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad orelse Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore BinOpMult NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr TupleLoad NameLoad BinOpAdd NameLoad Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return CompareGt Call NameLoad AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return CompareGt AttributeLoad NameLoad attr Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return CompareLt BinOpAdd AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return CompareGt AttributeLoad NameLoad attr Num decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults Num body If UnaryOpNot AttributeLoad NameLoad attr body Return Call NameLoad Num Num Assign NameStore Num Assign NameStore Call NameLoad Call NameLoad BinOpDiv Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore BinOpAdd AttributeLoad NameLoad attr Num Assign NameStore BinOpSub NameLoad BinOpDiv NameLoad Num Assign NameStore BinOpAdd BinOpAdd NameLoad BinOpDiv NameLoad Num BinOpSub BinOpMod NameLoad Num Num If CompareLt NameLoad NameLoad body Assign NameStore NameLoad If CompareGt NameLoad NameLoad body Assign NameStore NameLoad Return Call NameLoad NameLoad BinOpAdd NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body ImportFrom alias Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr If CompareEq BinOpAdd NameLoad Num NameLoad body Return Call NameLoad Str keyword NameLoad keyword NameLoad orelse Return Call NameLoad Str keyword BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index Num Num keyword SubscriptLoad AttributeLoad NameLoad attr Index Num keyword NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr For NameStore NameLoad body Expr Yield TupleLoad NameLoad NameLoad Assign NameStore NameLoad Expr Yield TupleLoad NameLoad NameLoad decorator_list Assign NameStore Call NameLoad GeneratorExp TupleLoad NameLoad BinOpMod Str Call NameLoad NameLoad comprehension NameStore Str Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str Call AttributeLoad Str attr NameLoad Str FunctionDef arguments args NameParam defaults body Expr Str FunctionDef arguments args NameParam defaults body Return SubscriptLoad NameLoad Index Call AttributeLoad NameLoad attr Num decorator_list Assign NameStore Call NameLoad NameLoad keyword NameLoad keyword TupleLoad Str Str Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list
N/A N/A Various utility functions and classes that support common presentation
tasks such as grouping or pagination.
 json dumps math ceil N/A re trac.core TracError N/A __all__ N/A captioned_button classes first_last group istext prepared_paginate paginate Paginator N/A __no_apidoc__ prepared_paginate captioned_button N/A N/A req symbol text N/A N/A N/A Return symbol and text or only symbol, according to user preferences. N/A N/A N/A N/A N/A req session get ui.use_symbols symbol N/A %s %s N/A symbol text N/A classes N/A N/A N/A args kwargs N/A N/A Helper function for dynamically assembling a list of CSS class names
    in templates.

    Any positional arguments are added to the list of class names. All
    positional arguments must be strings:

    >>> classes('foo', 'bar')
    u'foo bar'

    In addition, the names of any supplied keyword arguments are added if they
    have a truth value:

    >>> classes('foo', bar=True)
    u'foo bar'
    >>> classes('foo', bar=False)
    u'foo'

    If none of the arguments are added to the list, this function returns
    `None`:

    >>> classes(bar=False)
     N/A classes N/A N/A list N/A filter None args N/A k N/A N/A k v N/A N/A kwargs items v N/A N/A classes N/A N/A None N/A N/A N/A join classes N/A first_last N/A N/A idx seq N/A N/A N/A Generate ``first`` or ``last`` or both, according to the
    position `idx` in sequence `seq`.
     N/A N/A classes first N/A idx 0 last N/A idx N/A N/A len seq 1 N/A group N/A N/A iterable num predicate N/A None N/A N/A Combines the elements produced by the given iterable so that every `n`
    items are returned as a tuple.

    >>> items = [1, 2, 3, 4]
    >>> for item in group(items, 2):
    ...     print(item)
    (1, 2)
    (3, 4)

    The last tuple is padded with `None` values if its' length is smaller than
    `num`.

    >>> items = [1, 2, 3, 4, 5]
    >>> for item in group(items, 2):
    ...     print(item)
    (1, 2)
    (3, 4)
    (5, None)

    The optional `predicate` parameter can be used to flag elements that should
    not be packed together with other items. Only those elements where the
    predicate function returns True are grouped with other elements, otherwise
    they are returned as a tuple of length 1:

    >>> items = [1, 2, 3, 4]
    >>> for item in group(items, 2, lambda x: x != 3):
    ...     print(item)
    (1, 2)
    (3,)
    (4, None)
     N/A buf N/A N/A item iterable N/A N/A flush N/A predicate N/A N/A predicate item N/A N/A buf flush N/A N/A buf N/A N/A None N/A num N/A len buf N/A N/A N/A tuple buf N/A N/A buf N/A N/A N/A N/A buf append item N/A N/A flush N/A N/A len buf num N/A N/A N/A N/A tuple buf N/A N/A buf N/A N/A buf N/A N/A buf N/A N/A None N/A num N/A len buf N/A N/A N/A tuple buf N/A istext N/A N/A text N/A N/A N/A `True` for text (`unicode` and `str`), but `False` for `Markup`. genshi.core Markup N/A N/A N/A isinstance text basestring N/A N/A isinstance text Markup N/A prepared_paginate N/A N/A items num_items max_per_page N/A N/A N/A N/A max_per_page 0 N/A N/A num_pages 1 N/A N/A num_pages N/A int N/A ceil N/A N/A float num_items max_per_page N/A N/A items num_items num_pages N/A paginate N/A N/A items page max_per_page N/A 0 10 N/A N/A Simple generic pagination.

    Given an iterable, this function returns:
     * the slice of objects on the requested page,
     * the total number of items, and
     * the total number of pages.

    The `items` parameter can be a list, tuple, or iterator:

    >>> items = range(12)
    >>> items
    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
    >>> paginate(items)
    ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 12, 2)
    >>> paginate(items, page=1)
    ([10, 11], 12, 2)
    >>> paginate(iter(items))
    ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 12, 2)
    >>> paginate(iter(items), page=1)
    ([10, 11], 12, 2)

    This function also works with generators:

    >>> def generate():
    ...     for idx in range(12):
    ...         yield idx
    >>> paginate(generate())
    ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 12, 2)
    >>> paginate(generate(), page=1)
    ([10, 11], 12, 2)

    The `max_per_page` parameter can be used to set the number of items that
    should be displayed per page:

    >>> items = range(12)
    >>> paginate(items, page=0, max_per_page=6)
    ([0, 1, 2, 3, 4, 5], 12, 2)
    >>> paginate(items, page=1, max_per_page=6)
    ([6, 7, 8, 9, 10, 11], 12, 2)

    :raises TracError: if `page` is out of the range of the paginated
                       results.
     N/A N/A page N/A N/A page 0 N/A start N/A page max_per_page N/A stop N/A start max_per_page N/A count None N/A N/A hasattr items __len__ N/A N/A count N/A len items N/A N/A count N/A start count N/A trac.util.translation _ N/A N/A TracError N/A _ Page %(page)s is out of range. page page N/A N/A N/A retval N/A items N/A start stop N/A N/A N/A TypeError N/A N/A retval N/A N/A idx -1 N/A N/A idx item N/A enumerate items N/A N/A N/A start idx stop N/A N/A N/A N/A retval append item N/A N/A N/A count None N/A idx stop N/A N/A N/A N/A count None N/A N/A count N/A idx 1 N/A N/A retval count N/A int N/A ceil N/A N/A float count max_per_page N/A Paginator N/A object N/A N/A Pagination controller __init__ N/A N/A self items page max_per_page num_items N/A 0 10 None N/A N/A N/A page N/A N/A page 0 N/A N/A num_items None N/A N/A N/A items num_items num_pages N/A paginate items page max_per_page N/A N/A N/A items num_items num_pages N/A prepared_paginate items num_items max_per_page N/A offset N/A page max_per_page N/A N/A self page page N/A N/A self max_per_page max_per_page N/A N/A self items items N/A N/A self num_items num_items N/A N/A self num_pages num_pages N/A N/A self span N/A offset N/A offset N/A len items N/A N/A self show_index True N/A __iter__ N/A N/A self N/A N/A N/A N/A iter N/A self items N/A __len__ N/A N/A self N/A N/A N/A N/A len N/A self items N/A __nonzero__ N/A N/A self N/A N/A N/A N/A N/A len N/A self items 0 N/A __setitem__ N/A N/A self idx value N/A N/A N/A N/A N/A self items N/A idx value N/A has_more_pages N/A N/A self N/A N/A N/A N/A N/A self num_pages 1 N/A property has_next_page N/A N/A self N/A N/A N/A N/A N/A N/A self page 1 N/A self num_pages N/A property has_previous_page N/A N/A self N/A N/A N/A N/A N/A self page 0 N/A property get_shown_pages N/A N/A self page_index_count N/A 11 N/A N/A N/A N/A self has_more_pages N/A N/A N/A range 1 2 N/A min_page 1 N/A max_page N/A int N/A ceil N/A N/A float N/A self num_items N/A self max_per_page N/A current_page N/A N/A self page 1 N/A start_page N/A current_page N/A page_index_count 2 N/A end_page N/A N/A current_page N/A page_index_count 2 N/A N/A page_index_count 2 1 N/A N/A start_page min_page N/A N/A start_page min_page N/A N/A end_page max_page N/A N/A end_page max_page N/A N/A range start_page N/A end_page 1 N/A displayed_items N/A N/A self N/A N/A trac.util.translation _ N/A N/A start stop N/A self span N/A total N/A self num_items N/A N/A N/A start 1 stop N/A N/A N/A _ %(last)d of %(total)d last stop total total N/A N/A N/A _ %(start)d - %(stop)d of %(total)d start N/A N/A N/A self span N/A 0 1 stop N/A N/A self span N/A 1 total total N/A N/A separated N/A N/A items sep last N/A , None N/A N/A Yield `(item, sep)` tuples, one for each element in `items`.

    The separator after the last item is specified by the `last` parameter,
    which defaults to `None`. (Since 1.1.3)

    >>> list(separated([1, 2]))
    [(1, ','), (2, None)]

    >>> list(separated([1]))
    [(1, None)]

    >>> list(separated('abc', ':'))
    [('a', ':'), ('b', ':'), ('c', None)]

    >>> list(separated((1, 2, 3), sep=';', last='.'))
    [(1, ';'), (2, ';'), (3, '.')]
     N/A items N/A iter items N/A next N/A N/A items next N/A i items N/A N/A N/A N/A next sep N/A next i N/A N/A N/A next last N/A N/A _js_quote N/A dict N/A N/A c N/A \u%04x N/A ord c N/A c &<> N/A _js_quote_re N/A N/A re compile N/A N/A [ N/A N/A join _js_quote ] to_json N/A N/A value N/A N/A N/A Encode `value` to JSON. replace N/A N/A match N/A N/A N/A N/A _js_quote N/A N/A N/A match group 0 N/A N/A text N/A dumps value sort_keys True separators N/A , : N/A N/A N/A _js_quote_re sub replace text N/A