base.py 738 Bytes
Newer Older
1
# -*- coding: utf-8 -*-
Nathan Fritz's avatar
Nathan Fritz committed
2
"""
louiz’'s avatar
louiz’ committed
3
    slixmpp.xmlstream.matcher.base
4
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nathan Fritz's avatar
Nathan Fritz committed
5

louiz’'s avatar
louiz’ committed
6
    Part of Slixmpp: The Slick XMPP Library
7 8 9

    :copyright: (c) 2011 Nathanael C. Fritz
    :license: MIT, see LICENSE for more details
Nathan Fritz's avatar
Nathan Fritz committed
10
"""
11 12


Nathan Fritz's avatar
Nathan Fritz committed
13 14
class MatcherBase(object):

15 16 17 18
    """
    Base class for stanza matchers. Stanza matchers are used to pick
    stanzas out of the XML stream and pass them to the appropriate
    stream handlers.
19 20

    :param criteria: Object to compare some aspect of a stanza against.
21 22 23 24 25 26
    """

    def __init__(self, criteria):
        self._criteria = criteria

    def match(self, xml):
27
        """Check if a stanza matches the stored criteria.
28 29 30 31

        Meant to be overridden.
        """
        return False