From b5a14a0190f6ea45bfbc0e18a7ff6c61b6415865 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Mon, 19 Jul 2010 19:19:33 -0400 Subject: Can now pass a name to add_handler so that the handler can be reliably removed later. Updated uses of add_handler to include a name. --- sleekxmpp/plugins/xep_0050.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sleekxmpp/plugins/xep_0050.py') diff --git a/sleekxmpp/plugins/xep_0050.py b/sleekxmpp/plugins/xep_0050.py index 2f356e17..11a17728 100644 --- a/sleekxmpp/plugins/xep_0050.py +++ b/sleekxmpp/plugins/xep_0050.py @@ -32,11 +32,11 @@ class xep_0050(base.base_plugin): def plugin_init(self): self.xep = '0050' self.description = 'Ad-Hoc Commands' - self.xmpp.add_handler("" % self.xmpp.default_ns, self.handler_command) - self.xmpp.add_handler("" % self.xmpp.default_ns, self.handler_command) - self.xmpp.add_handler("" % self.xmpp.default_ns, self.handler_command_next, threaded=True) - self.xmpp.add_handler("" % self.xmpp.default_ns, self.handler_command_cancel) - self.xmpp.add_handler("" % self.xmpp.default_ns, self.handler_command_complete) + self.xmpp.add_handler("" % self.xmpp.default_ns, self.handler_command, name='Ad-Hoc None') + self.xmpp.add_handler("" % self.xmpp.default_ns, self.handler_command, name='Ad-Hoc Execute') + self.xmpp.add_handler("" % self.xmpp.default_ns, self.handler_command_next, name='Ad-Hoc Next', threaded=True) + self.xmpp.add_handler("" % self.xmpp.default_ns, self.handler_command_cancel, name='Ad-Hoc Cancel') + self.xmpp.add_handler("" % self.xmpp.default_ns, self.handler_command_complete, name='Ad-Hoc Complete') self.commands = {} self.sessions = {} self.sd = self.xmpp.plugin['xep_0030'] -- cgit v1.2.3 From 690eaf8d3c3856c6242612da22e6c6d323f193ed Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Tue, 20 Jul 2010 11:19:49 -0400 Subject: Updated license notices to use the correct MIT format. Also corrected references to nonexistant license.txt to LICENSE. --- sleekxmpp/plugins/xep_0050.py | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'sleekxmpp/plugins/xep_0050.py') diff --git a/sleekxmpp/plugins/xep_0050.py b/sleekxmpp/plugins/xep_0050.py index 11a17728..319401b4 100644 --- a/sleekxmpp/plugins/xep_0050.py +++ b/sleekxmpp/plugins/xep_0050.py @@ -1,21 +1,9 @@ """ - SleekXMPP: The Sleek XMPP Library - Copyright (C) 2007 Nathanael C. Fritz - This file is part of SleekXMPP. - - SleekXMPP is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - SleekXMPP is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with SleekXMPP; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + SleekXMPP: The Sleek XMPP Library + Copyright (C) 2010 Nathanael C. Fritz + This file is part of SleekXMPP. + + See the file LICENSE for copying permission. """ from __future__ import with_statement from . import base -- cgit v1.2.3 From b67b930596bfb0748b67bde02d37f2277d8c9576 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Tue, 20 Jul 2010 12:27:22 -0400 Subject: Updated xep_0050 to use old_0004 for now. --- sleekxmpp/plugins/xep_0050.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sleekxmpp/plugins/xep_0050.py') diff --git a/sleekxmpp/plugins/xep_0050.py b/sleekxmpp/plugins/xep_0050.py index 319401b4..4ff42859 100644 --- a/sleekxmpp/plugins/xep_0050.py +++ b/sleekxmpp/plugins/xep_0050.py @@ -71,7 +71,7 @@ class xep_0050(base.base_plugin): in_command = xml.find('{http://jabber.org/protocol/commands}command') sessionid = in_command.get('sessionid', None) pointer = self.sessions[sessionid]['next'] - results = self.xmpp.plugin['xep_0004'].makeForm('result') + results = self.xmpp.plugin['old_0004'].makeForm('result') results.fromXML(in_command.find('{jabber:x:data}x')) pointer(results,sessionid) self.xmpp.send(self.makeCommand(xml.attrib['from'], in_command.attrib['node'], form=None, id=xml.attrib['id'], sessionid=sessionid, status='completed', actions=[])) @@ -82,7 +82,7 @@ class xep_0050(base.base_plugin): in_command = xml.find('{http://jabber.org/protocol/commands}command') sessionid = in_command.get('sessionid', None) pointer = self.sessions[sessionid]['next'] - results = self.xmpp.plugin['xep_0004'].makeForm('result') + results = self.xmpp.plugin['old_0004'].makeForm('result') results.fromXML(in_command.find('{jabber:x:data}x')) form, npointer, next = pointer(results,sessionid) self.sessions[sessionid]['next'] = npointer -- cgit v1.2.3 From c8989c04f3675235e3ae730cb240e2154b5d9e76 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Mon, 26 Jul 2010 21:02:25 -0400 Subject: Replaced traceback calls to use logging.exception where applicable. --- sleekxmpp/plugins/xep_0050.py | 1 - 1 file changed, 1 deletion(-) (limited to 'sleekxmpp/plugins/xep_0050.py') diff --git a/sleekxmpp/plugins/xep_0050.py b/sleekxmpp/plugins/xep_0050.py index 4ff42859..5efb9116 100644 --- a/sleekxmpp/plugins/xep_0050.py +++ b/sleekxmpp/plugins/xep_0050.py @@ -9,7 +9,6 @@ from __future__ import with_statement from . import base import logging from xml.etree import cElementTree as ET -import traceback import time class xep_0050(base.base_plugin): -- cgit v1.2.3