refactoring: using xml params part III (parameters import)
This commit is contained in:
parent
a18f064aa2
commit
ea056ce96e
2 changed files with 52 additions and 13 deletions
|
|
@ -451,6 +451,15 @@ class Socks5ClientFactory(protocol.ClientFactory):
|
|||
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 @@ class XEP_0065(XMPPHandler):
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ PLUGIN_INFO = {
|
|||
|
||||
class XEP_0096(XMPPHandler):
|
||||
implements(iwokkel.IDisco)
|
||||
|
||||
|
||||
def __init__(self, host):
|
||||
info("Plugin XEP_0096 initialization")
|
||||
self.host = host
|
||||
|
|
|
|||
Loading…
Reference in a new issue