diff plugins/plugin_xep_0065.py @ 19:f2a745ca0fbc

refactoring: using xml params part III (parameters import)
author Goffi <goffi@goffi.org>
date Sat, 07 Nov 2009 21:23:28 +0100
parents 218ec9984fa5
children fc8c202cda87
line wrap: on
line diff
--- a/plugins/plugin_xep_0065.py	Fri Nov 06 23:31:00 2009 +0100
+++ b/plugins/plugin_xep_0065.py	Sat Nov 07 21:23:28 2009 +0100
@@ -451,6 +451,15 @@
 class XEP_0065(XMPPHandler):
     implements(iwokkel.IDisco)
     
+    params = """
+    <params>
+    <category name="File Transfert">
+        <param name="IP" value="192.168.0.10" type="string" />
+        <param name="Port" value="28915" type="string" />
+    </category>
+    </params>
+    """
+    
     def __init__(self, host):
         info("Plugin XEP_0065 initialization")
         self.host = host
@@ -458,6 +467,7 @@
         self.server_factory = Socks5ServerFactory()
         self.server_factory.protocol.host = self.host #needed for progress CB
         self.client_factory = Socks5ClientFactory()
+        host.memory.import_params(self, XEP_0065.params)
         port = int(self.host.memory.getParamV("Port", "File Transfert"))
         info("Launching Socks5 Stream server on port %d", port)
         reactor.listenTCP(port, self.server_factory)