Module ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Call NameLoad Str ListLoad Str Str Str Expr Str ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam defaults AttributeLoad NameLoad attr body Expr Str If CompareLt NameLoad Num body Raise Call NameLoad Str Expr Call AttributeLoad Call NameLoad attr keyword BinOpAdd NameLoad Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore NameLoad If CompareIn NameLoad NameLoad body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad If CompareGt Call NameLoad NameLoad Num body Assign NameStore Call NameLoad NameLoad NameLoad SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list decorator_list
N/A collections namedtuple util ordered N/A defaults N/A Revert N/A namedtuple Revert N/A reverting reverteds reverted_to N/A 
Represents a revert event.  This class behaves like
:class:`collections.namedtuple`.  Note that the datatypes of `reverting`,
`reverteds` and `reverted_to` is not specified since those types will depend
on the revision data provided during revert detection.

:Members:
    **reverting**
        The reverting revision data : `mixed`
    **reverteds**
        The reverted revision data (ordered chronologically) : list( `mixed` )
    **reverted_to**
        The reverted-to revision data : `mixed`
 Detector N/A N/A ordered HistoricalMap N/A N/A 
    Detects revert events in a stream of revisions (to the same page) based on
    matching checksums.  To detect reverts, construct an instance of this class and call
    :meth:`process` in chronological order (``direction == "newer"``).

    See `<https://meta.wikimedia.org/wiki/R:Identity_revert>`_

    :Parameters:
        radius : int
            a positive integer indicating the maximum revision distance that a revert can span.

    :Example:
        >>> from mw.lib import reverts
        >>> detector = reverts.Detector()
        >>>
        >>> detector.process("aaa", {'rev_id': 1})
        >>> detector.process("bbb", {'rev_id': 2})
        >>> detector.process("aaa", {'rev_id': 3})
        Revert(reverting={'rev_id': 3}, reverteds=[{'rev_id': 2}], reverted_to={'rev_id': 1})
        >>> detector.process("ccc", {'rev_id': 4})

     __init__ N/A N/A self radius N/A N/A defaults RADIUS N/A N/A 
        :Parameters:
            radius : int
                a positive integer indicating the maximum revision distance that a revert can span.
         N/A N/A radius 1 N/A N/A N/A TypeError invalid radius. Expected a positive integer. N/A N/A N/A N/A super __init__ maxlen N/A radius 1 N/A process N/A N/A self checksum revision N/A None N/A N/A 
        Process a new revision and detect a revert if it occurred.  Note that
        you can pass whatever you like as `revision` and it will be returned in
        the case that a revert occurs.

        :Parameters:
            checksum : str
                Any identity-machable string-based hash of revision content
            revision : `mixed`
                Revision meta data.  Note that any data will just be returned in the
                case of a revert.

        :Returns:
            a :class:`~mw.lib.reverts.Revert` if one occured or `None`
         N/A revert None N/A N/A checksum self N/A N/A reverteds N/A list N/A N/A self up_to checksum N/A N/A N/A len reverteds 0 N/A N/A revert N/A Revert revision reverteds N/A self N/A checksum N/A N/A N/A self insert checksum revision N/A revert N/A N/A