view idavoll/tap.py @ 50:64f0986d8b35

Implement add_subscription() and remove_subscription() for Storage, remove implementation from BackendService. Make SubscriptionService subclass of backend.SubscriptionService. Fix create_node() implementation so it works with the backend (still needs factoring out to benefit other storages).
author Ralph Meijer <ralphm@ik.nu>
date Wed, 03 Nov 2004 16:19:17 +0000
parents 7d088c61e131
children 66fac7cd9edc
line wrap: on
line source

from twisted.application import internet, service
from twisted.internet import interfaces
from twisted.python import usage
import idavoll

class Options(usage.Options):
	optParameters = [
		('jid', None, 'pubsub'),
		('secret', None, None),
		('rhost', None, '127.0.0.1'),
		('rport', None, '6000'),
		('backend', None, 'memory'),
		('dbuser', None, ''),
		('dbname', None, 'pubsub'),
	]
	
	def postOptions(self):
		if self['backend'] not in ['pgsql', 'memory']:
			raise usage.UsageError, "Unknown backend!"

def makeService(config):
	return idavoll.makeService(config)