changeset 192:a219fe70a762

Use ServiceMaker to setup twistd plugins, if available.
author Ralph Meijer <ralphm@ik.nu>
date Fri, 30 May 2008 09:56:08 +0000
parents 48245777acea
children 8ab16e319bb8
files twisted/plugins/idavoll.py twisted/plugins/idavoll_http.py
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/twisted/plugins/idavoll.py	Sat May 17 18:31:31 2008 +0000
+++ b/twisted/plugins/idavoll.py	Fri May 30 09:56:08 2008 +0000
@@ -1,9 +1,12 @@
 # Copyright (c) 2003-2006 Ralph Meijer
 # See LICENSE for details.
 
-from twisted.scripts.mktap import _tapHelper
+try:
+    from twisted.application.service import ServiceMaker
+except ImportError:
+    from twisted.scripts.mktap import _tapHelper as ServiceMaker
 
-Idavoll = _tapHelper(
+Idavoll = ServiceMaker(
         "Idavoll",
         "idavoll.tap",
         "Jabber Publish-Subscribe Service Component",
--- a/twisted/plugins/idavoll_http.py	Sat May 17 18:31:31 2008 +0000
+++ b/twisted/plugins/idavoll_http.py	Fri May 30 09:56:08 2008 +0000
@@ -1,9 +1,12 @@
 # Copyright (c) 2003-2008 Ralph Meijer
 # See LICENSE for details.
 
-from twisted.scripts.mktap import _tapHelper
+try:
+    from twisted.application.service import ServiceMaker
+except ImportError:
+    from twisted.scripts.mktap import _tapHelper as ServiceMaker
 
-Idavoll = _tapHelper(
+Idavoll = ServiceMaker(
         "Idavoll HTTP",
         "idavoll.tap_http",
         "Jabber Publish-Subscribe Service Component with HTTP gateway",