From d90aec17e2201f256783a531c548dcc9857c889d Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Fri, 31 Dec 2010 19:19:25 +0100 Subject: Cleanup of repository. Bases of webclient. * remove sleekxmpp (install guideline in server/README) * move server code to server directory * webclient directory with basic strophejs example --- sleekxmpp/stanza/nick.py | 89 ------------------------------------------------ 1 file changed, 89 deletions(-) delete mode 100644 sleekxmpp/stanza/nick.py (limited to 'sleekxmpp/stanza/nick.py') diff --git a/sleekxmpp/stanza/nick.py b/sleekxmpp/stanza/nick.py deleted file mode 100644 index a9243d1..0000000 --- a/sleekxmpp/stanza/nick.py +++ /dev/null @@ -1,89 +0,0 @@ -""" - 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 sleekxmpp.stanza import Message, Presence -from sleekxmpp.xmlstream import ElementBase, ET, register_stanza_plugin - - -class Nick(ElementBase): - - """ - XEP-0172: User Nickname allows the addition of a element - in several stanza types, including and stanzas. - - The nickname contained in a should be the global, friendly or - informal name chosen by the owner of a bare JID. The element - may be included when establishing communications with new entities, - such as normal XMPP users or MUC services. - - The nickname contained in a element will not necessarily be - the same as the nickname used in a MUC. - - Example stanzas: - - The User - ... - - - - The User - - - Stanza Interface: - nick -- A global, friendly or informal name chosen by a user. - - Methods: - setup -- Overrides ElementBase.setup. - get_nick -- Return the nickname in the element. - set_nick -- Add a element with the given nickname. - del_nick -- Remove the element. - """ - - namespace = 'http://jabber.org/nick/nick' - name = 'nick' - plugin_attrib = name - interfaces = set(('nick',)) - - def setup(self, xml=None): - """ - Populate the stanza object using an optional XML object. - - Overrides StanzaBase.setup. - - Arguments: - xml -- Use an existing XML object for the stanza's values. - """ - # To comply with PEP8, method names now use underscores. - # Deprecated method names are re-mapped for backwards compatibility. - self.setNick = self.set_nick - self.getNick = self.get_nick - self.delNick = self.del_nick - - return ElementBase.setup(self, xml) - - def set_nick(self, nick): - """ - Add a element with the given nickname. - - Arguments: - nick -- A human readable, informal name. - """ - self.xml.text = nick - - def get_nick(self): - """Return the nickname in the element.""" - return self.xml.text - - def del_nick(self): - """Remove the element.""" - if self.parent is not None: - self.parent().xml.remove(self.xml) - - -register_stanza_plugin(Message, Nick) -register_stanza_plugin(Presence, Nick) -- cgit v1.2.3-70-g09d2