diff options
author | Nathan Fritz <nathan@andyet.net> | 2010-07-26 18:13:34 -0700 |
---|---|---|
committer | Nathan Fritz <nathan@andyet.net> | 2010-07-26 18:13:34 -0700 |
commit | a349a2a317a6ca7152e0adb21d5fabbfd632ebaf (patch) | |
tree | 4af70fddfe8cd243b596f734d9a87c37c6a96ab9 | |
parent | 2cb82afc2cd35051a89c5d843f13bbf0132e2003 (diff) | |
download | slixmpp-a349a2a317a6ca7152e0adb21d5fabbfd632ebaf.tar.gz slixmpp-a349a2a317a6ca7152e0adb21d5fabbfd632ebaf.tar.bz2 slixmpp-a349a2a317a6ca7152e0adb21d5fabbfd632ebaf.tar.xz slixmpp-a349a2a317a6ca7152e0adb21d5fabbfd632ebaf.zip |
removed jid from stanzabase to external file
-rw-r--r-- | sleekxmpp/xmlstream/stanzabase.py | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/sleekxmpp/xmlstream/stanzabase.py b/sleekxmpp/xmlstream/stanzabase.py index 66a08e49..8af90a0f 100644 --- a/sleekxmpp/xmlstream/stanzabase.py +++ b/sleekxmpp/xmlstream/stanzabase.py @@ -11,6 +11,7 @@ import traceback import sys import weakref import copy +from . jid import JID if sys.version_info < (3,0): from . import tostring26 as tostring @@ -29,28 +30,6 @@ def registerStanzaPlugin(stanza, plugin): stanza.plugin_tag_map[tag] = plugin -class JID(object): - def __init__(self, jid): - self.jid = jid - - def __getattr__(self, name): - if name == 'resource': - return self.jid.split('/', 1)[-1] - elif name == 'user': - if '@' in self.jid: - return self.jid.split('@', 1)[0] - else: - return '' - elif name == 'server': - return self.jid.split('@', 1)[-1].split('/', 1)[0] - elif name == 'full': - return self.jid - elif name == 'bare': - return self.jid.split('/', 1)[0] - - def __str__(self): - return self.jid - class ElementBase(tostring.ToString): name = 'stanza' plugin_attrib = 'plugin' |