Package pyxmpp2 :: Module jid :: Class JID
[hide private]

Class JID


JID.

JID objects are immutable. They are also cached for better performance.

Instance Methods [hide private]
 
__setattr__(self, name, value)
x.__setattr__('name', value) <==> x.name = value
 
__attribute_declarations__(self)
 
__unicode__(self)
 
__repr__(self)
repr(x)
 
as_utf8(self)
UTF-8 encoded JID representation.
 
as_string(self)
UTF-8 encoded JID representation.
 
as_unicode(self)
Unicode string JID representation.
 
bare(self)
Make bare JID made by removing resource from current self.
 
__eq__(self, other)
 
__ne__(self, other)
 
__cmp__(self, other)
 
__hash__(self)
hash(x)

Inherited from object: __delattr__, __format__, __getattribute__, __init__, __reduce__, __reduce_ex__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
__from_unicode(cls, data, check=True)
Return jid tuple from an Unicode string.
Static Methods [hide private]
a new object with type S, a subtype of T
__new__(cls, local_or_jid=None, domain=None, resource=None, check=True)
Create a new JID object or take one from the cache.
 
__prepare_local(data)
Prepare localpart of the JID
 
__prepare_domain(data)
Prepare domainpart of the JID.
 
__prepare_resource(data)
Prepare the resourcepart of the JID.
Class Variables [hide private]
  cache = <WeakValueDictionary at 141133036>
Instance Variables [hide private]
  domain
domainpart of the JID
  local
localpart of the JID
  resource
resourcepart of the JID
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__new__(cls, local_or_jid=None, domain=None, resource=None, check=True)
Static Method

 
Create a new JID object or take one from the cache.
Parameters:
  • local_or_jid - localpart of the JID, JID object to copy, or Unicode representation of the JID.
  • domain - domain part of the JID
  • resource - resource part of the JID
  • check - if False then JID is not checked for specifiaction compliance.
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

__setattr__(self, name, value)

 
x.__setattr__('name', value) <==> x.name = value
Overrides: object.__setattr__
(inherited documentation)

__from_unicode(cls, data, check=True)
Class Method

 
Return jid tuple from an Unicode string.
Parameters:
  • data - the JID string
  • check - when False then the JID is not checked for specification compliance.
Returns:
(localpart, domainpart, resourcepart) tuple

__prepare_local(data)
Static Method

 
Prepare localpart of the JID
Parameters:
  • data (unicode) - localpart of the JID
Raises:

__prepare_domain(data)
Static Method

 
Prepare domainpart of the JID.
Parameters:
  • data (unicode) - Domain part of the JID
Raises:
  • JIDError - if the domain name is too long.

__prepare_resource(data)
Static Method

 
Prepare the resourcepart of the JID.
Parameters:
  • data - Resourcepart of the JID
Raises:

__repr__(self)
(Representation operator)

 
repr(x)
Overrides: object.__repr__
(inherited documentation)

as_utf8(self)

 
UTF-8 encoded JID representation.
Returns:
UTF-8 encoded JID.

as_string(self)

 

UTF-8 encoded JID representation.

Deprecated Always use Unicode objects, or as_utf8 if you really want.

Returns:
UTF-8 encoded JID.

as_unicode(self)

 
Unicode string JID representation.
Returns:
JID as Unicode string.

bare(self)

 
Make bare JID made by removing resource from current self.
Returns:
new JID object without resource part.

__hash__(self)
(Hashing function)

 
hash(x)
Overrides: object.__hash__
(inherited documentation)