summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/XMPPInterface.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-07-07 01:23:55 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-07-07 01:23:55 +0200
commitb1759bc440cd6013837697eb8de540914f693ffd (patch)
treed170caf63d7f65e44d23ea2d91a65759a1665928 /module/plugins/hooks/XMPPInterface.py
parent[Plugin] Fix decoding in load method (diff)
downloadpyload-b1759bc440cd6013837697eb8de540914f693ffd.tar.xz
No camelCase style anymore
Diffstat (limited to 'module/plugins/hooks/XMPPInterface.py')
-rw-r--r--module/plugins/hooks/XMPPInterface.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py
index 8a76257ad..a2c32166f 100644
--- a/module/plugins/hooks/XMPPInterface.py
+++ b/module/plugins/hooks/XMPPInterface.py
@@ -12,7 +12,7 @@ from module.plugins.hooks.IRCInterface import IRCInterface
class XMPPInterface(IRCInterface, JabberClient):
__name__ = "XMPPInterface"
__type__ = "hook"
- __version__ = "0.11"
+ __version__ = "0.12"
__config__ = [("jid" , "str" , "Jabber ID" , "user@exmaple-jabber-server.org" ),
("pw" , "str" , "Password" , "" ),
@@ -33,14 +33,14 @@ class XMPPInterface(IRCInterface, JabberClient):
def __init__(self, core, manager):
IRCInterface.__init__(self, core, manager)
- self.jid = JID(self.getConfig('jid'))
- password = self.getConfig('pw')
+ self.jid = JID(self.get_config('jid'))
+ password = self.get_config('pw')
#: if bare JID is provided add a resource -- it is required
if not self.jid.resource:
self.jid = JID(self.jid.node, self.jid.domain, "pyLoad")
- if self.getConfig('tls'):
+ if self.get_config('tls'):
tls_settings = streamtls.TLSSettings(require=True, verify_peer=False)
auth = ("sasl:PLAIN", "sasl:DIGEST-MD5")
else:
@@ -67,7 +67,7 @@ class XMPPInterface(IRCInterface, JabberClient):
def package_finished(self, pypack):
try:
- if self.getConfig('info_pack'):
+ if self.get_config('info_pack'):
self.announce(_("Package finished: %s") % pypack.name)
except Exception:
pass
@@ -75,7 +75,7 @@ class XMPPInterface(IRCInterface, JabberClient):
def download_finished(self, pyfile):
try:
- if self.getConfig('info_file'):
+ if self.get_config('info_file'):
self.announce(
_("Download finished: %(name)s @ %(plugin)s") % {"name": pyfile.name, "plugin": pyfile.pluginname})
except Exception:
@@ -88,7 +88,7 @@ class XMPPInterface(IRCInterface, JabberClient):
try:
self.loop()
except Exception, ex:
- self.logError(ex)
+ self.log_error(ex)
def stream_state_changed(self, state, arg):
@@ -97,19 +97,19 @@ class XMPPInterface(IRCInterface, JabberClient):
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))
+ self.log_debug("*** State changed: %s %r ***" % (state, arg))
def disconnected(self):
- self.logDebug("Client was disconnected")
+ self.log_debug("Client was disconnected")
def stream_closed(self, stream):
- self.logDebug("Stream was closed", stream)
+ self.log_debug("Stream was closed", stream)
def stream_error(self, err):
- self.logDebug("Stream Error", err)
+ self.log_debug("Stream Error", err)
def get_message_handlers(self):
@@ -129,8 +129,8 @@ class XMPPInterface(IRCInterface, JabberClient):
subject = stanza.get_subject()
body = stanza.get_body()
t = stanza.get_type()
- self.logDebug("Message from %s received." % stanza.get_from())
- self.logDebug("Body: %s Subject: %s Type: %s" % (body, subject, t))
+ self.log_debug("Message from %s received." % stanza.get_from())
+ self.log_debug("Body: %s Subject: %s Type: %s" % (body, subject, t))
if t == "headline":
#: 'headline' messages should never be replied to
@@ -141,11 +141,11 @@ class XMPPInterface(IRCInterface, JabberClient):
to_jid = stanza.get_from()
from_jid = stanza.get_to()
- #j = JID()
+ # j = JID()
to_name = to_jid.as_utf8()
from_name = from_jid.as_utf8()
- names = self.getConfig('owners').split(";")
+ names = self.get_config('owners').split(";")
if to_name in names or to_jid.node + "@" + to_jid.domain in names:
messages = []
@@ -174,7 +174,7 @@ class XMPPInterface(IRCInterface, JabberClient):
messages.append(m)
except Exception, e:
- self.logError(e)
+ self.log_error(e)
return messages
@@ -190,8 +190,8 @@ class XMPPInterface(IRCInterface, JabberClient):
"""
Send message to all owners
"""
- for user in self.getConfig('owners').split(";"):
- self.logDebug("Send message to", user)
+ for user in self.get_config('owners').split(";"):
+ self.log_debug("Send message to", user)
to_jid = JID(user)