summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/XMPPInterface.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-22 19:44:59 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-22 19:47:17 +0200
commit0eb6e7ec4a1144dcca824d8add049787d3da1762 (patch)
treed653f5fe28bb247a3c4fadeca9bf6278d744f929 /module/plugins/hooks/XMPPInterface.py
parentSpare code cosmetics (diff)
downloadpyload-0eb6e7ec4a1144dcca824d8add049787d3da1762.tar.xz
Two space before function declaration
Diffstat (limited to 'module/plugins/hooks/XMPPInterface.py')
-rw-r--r--module/plugins/hooks/XMPPInterface.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py
index b32eeb40b..c4d6e1b66 100644
--- a/module/plugins/hooks/XMPPInterface.py
+++ b/module/plugins/hooks/XMPPInterface.py
@@ -30,6 +30,7 @@ class XMPPInterface(IRCInterface, JabberClient):
implements(IMessageHandlersProvider)
+
def __init__(self, core, manager):
IRCInterface.__init__(self, core, manager)
@@ -58,11 +59,13 @@ class XMPPInterface(IRCInterface, JabberClient):
self,
]
+
def coreReady(self):
self.new_package = {}
self.start()
+
def packageFinished(self, pypack):
try:
if self.getConfig("info_pack"):
@@ -70,6 +73,7 @@ class XMPPInterface(IRCInterface, JabberClient):
except:
pass
+
def downloadFinished(self, pyfile):
try:
if self.getConfig("info_file"):
@@ -78,6 +82,7 @@ class XMPPInterface(IRCInterface, JabberClient):
except:
pass
+
def run(self):
# connect to IRC etc.
self.connect()
@@ -86,21 +91,26 @@ class XMPPInterface(IRCInterface, JabberClient):
except Exception, ex:
self.logError(ex)
+
def stream_state_changed(self, state, arg):
"""This one is called when the state of stream connecting the component
to a server changes. This will usually be used to let the user
know what is going on."""
self.logDebug("*** State changed: %s %r ***" % (state, arg))
+
def disconnected(self):
self.logDebug("Client was disconnected")
+
def stream_closed(self, stream):
self.logDebug("Stream was closed", stream)
+
def stream_error(self, err):
self.logDebug("Stream Error", err)
+
def get_message_handlers(self):
"""Return list of (message_type, message_handler) tuples.
@@ -108,6 +118,7 @@ class XMPPInterface(IRCInterface, JabberClient):
in a client session."""
return [("normal", self.message)]
+
def message(self, stanza):
"""Message handler for the component."""
subject = stanza.get_subject()
@@ -165,9 +176,11 @@ class XMPPInterface(IRCInterface, JabberClient):
else:
return True
+
def response(self, msg, origin=""):
return self.announce(msg)
+
def announce(self, message):
""" send message to all owners"""
for user in self.getConfig("owners").split(";"):
@@ -187,9 +200,11 @@ class XMPPInterface(IRCInterface, JabberClient):
stream.send(m)
+
def beforeReconnecting(self, ip):
self.disconnect()
+
def afterReconnecting(self, ip):
self.connect()
@@ -202,24 +217,29 @@ class VersionHandler(object):
implements(IIqHandlersProvider, IFeaturesProvider)
+
def __init__(self, client):
"""Just remember who created this."""
self.client = client
+
def get_features(self):
"""Return namespace which should the client include in its reply to a
disco#info query."""
return ["jabber:iq:version"]
+
def get_iq_get_handlers(self):
"""Return list of tuples (element_name, namespace, handler) describing
handlers of <iq type='get'/> stanzas"""
return [("query", "jabber:iq:version", self.get_version)]
+
def get_iq_set_handlers(self):
"""Return empty list, as this class provides no <iq type='set'/> stanza handler."""
return []
+
def get_version(self, iq):
"""Handler for jabber:iq:version queries.