summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/handler/base.py
blob: a44edf0eb8c6b0922ae9d35819bcd62c673a0993 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""
    SleekXMPP: The Sleek XMPP Library
    Copyright (C) 2010  Nathanael C. Fritz
    This file is part of SleekXMPP.

    See the file license.txt for copying permission.
"""

class BaseHandler(object):


	def __init__(self, name, matcher):
		self.name = name
		self._destroy = False
		self._payload = None
		self._matcher = matcher
	
	def match(self, xml):
		return self._matcher.match(xml)
	
	def prerun(self, payload): # what's the point of this if the payload is called again in run??
		self._payload = payload

	def run(self, payload):
		self._payload = payload
	
	def checkDelete(self):
		return self._destroy