view idavoll/backend.py @ 24:4f3bbefc6fad

Moved memory backend to its own file. Cleaned up exceptions, naming.
author Ralph Meijer <ralphm@ik.nu>
date Sun, 17 Oct 2004 13:51:34 +0000
parents 884268687229
children d4fc29bb5381
line wrap: on
line source

from twisted.python import components

class IService(components.Interface):
	""" Interface to a backend service of a pubsub service """

	def do_publish(self, node, publisher, item):
		""" Returns a deferred that returns """

class Error(Exception):
	msg = ''

	def __str__(self):
		return self.msg
	
class NodeNotFound(Error):
	msg = 'Node not found'

class NotAuthorized(Error):
	pass

class PayloadExpected(Error):
	msg = 'Payload expected'

class NoPayloadAllowed(Error):
	msg = 'No payload allowed'

class NoInstantNodes(Error):
	pass

class NodeExists(Error):
	pass