diff idavoll/tap.py @ 177:faf1c9bc2612

Add HTTP gateway in a separate plugin. Author: ralphm Fixes #8.
author Ralph Meijer <ralphm@ik.nu>
date Thu, 10 Apr 2008 11:18:29 +0000
parents 17fc5dd77158
children c61034369463
line wrap: on
line diff
--- a/idavoll/tap.py	Wed Apr 09 13:15:39 2008 +0000
+++ b/idavoll/tap.py	Thu Apr 10 11:18:29 2008 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2003-2007 Ralph Meijer
+# Copyright (c) 2003-2008 Ralph Meijer
 # See LICENSE for details.
 
 from twisted.application import service
@@ -37,6 +37,8 @@
         if self['backend'] not in ['pgsql', 'memory']:
             raise usage.UsageError, "Unknown backend!"
 
+        self['jid'] = JID(self['jid'])
+
 def makeService(config):
     s = service.MultiService()
 
@@ -54,12 +56,14 @@
         st = Storage()
 
     bs = BackendService(st)
+    bs.setName('backend')
     bs.setServiceParent(s)
 
     # Set up XMPP server-side component with publish-subscribe capabilities
 
     cs = Component(config["rhost"], int(config["rport"]),
-                   config["jid"], config["secret"])
+                   config["jid"].full(), config["secret"])
+    cs.setName('component')
     cs.setServiceParent(s)
 
     cs.factory.maxDelay = 900
@@ -74,6 +78,6 @@
     ps = IPubSubService(bs)
     ps.setHandlerParent(cs)
     ps.hideNodes = config["hide-nodes"]
-    ps.serviceJID = JID(config["jid"])
+    ps.serviceJID = config["jid"]
 
     return s