Package pyxmpp :: Package jabber :: Module delay :: Class Delay
[show private | hide private]
[frames | no frames]

Type Delay

         object --+    
                  |    
StanzaPayloadObject --+
                      |
                     Delay


Delayed delivery tag.

Represents 'jabber:x:delay' (JEP-0091) element of a Jabber stanza.

:Ivariables:
    - `delay_from`: the "from" value of the delay element
    - `reason`: the "reason" (content) of the delay element
    - `timestamp`: the UTC timestamp as naive datetime object

Method Summary
  __init__(self, node_or_datetime, delay_from, reason, utc)
Initialize the Delay object.
  __cmp__(self, other)
  __str__(self)
  complete_xml_element(self, xmlnode, _unused)
Complete the XML node with `self` content.
  from_xml(self, xmlnode)
Initialize Delay object from an XML node.
  get_datetime_local(self)
Get the timestamp as a local time.
  get_datetime_utc(self)
Get the timestamp as a UTC.
    Inherited from StanzaPayloadObject
  as_xml(self, parent, doc)
Get the XML representation of `self`.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value

Class Variable Summary
str xml_element_name = 'x'
str xml_element_namespace = 'jabber:x:delay'

Method Details

__init__(self, node_or_datetime, delay_from=None, reason=None, utc=True)
(Constructor)

Initialize the Delay object.

:Parameters:
    - `node_or_datetime`: an XML node to parse or the timestamp.
    - `delay_from`: JID of the entity which adds the delay mark
      (when `node_or_datetime` is a timestamp).
    - `reason`: reason of the delay (when `node_or_datetime` is a
      timestamp).
    - `utc`: if `True` then the timestamp is assumed to be UTC,
      otherwise it is assumed to be local time.
:Types:
    - `node_or_datetime`: `libxml2.xmlNode` or `datetime.datetime`
    - `delay_from`: `pyxmpp.JID`
    - `reason`: `unicode`
    - `utc`: `bool`
Overrides:
__builtin__.object.__init__

complete_xml_element(self, xmlnode, _unused)

Complete the XML node with `self` content.

Should be overriden in classes derived from `StanzaPayloadObject`.

:Parameters:
    - `xmlnode`: XML node with the element being built. It has already
      right name and namespace, but no attributes or content.
    - `_unused`: document to which the element belongs.
:Types:
    - `xmlnode`: `libxml2.xmlNode`
    - `_unused`: `libxml2.xmlDoc`
Overrides:
pyxmpp.objects.StanzaPayloadObject.complete_xml_element

from_xml(self, xmlnode)

Initialize Delay object from an XML node.

:Parameters:
    - `xmlnode`: the jabber:x:delay XML element.
:Types:
    - `xmlnode`: `libxml2.xmlNode`

get_datetime_local(self)

Get the timestamp as a local time.

:return: the timestamp of the delay element represented in the local
  timezone.
:returntype: `datetime.datetime`

get_datetime_utc(self)

Get the timestamp as a UTC.

:return: the timestamp of the delay element represented in UTC.
:returntype: `datetime.datetime`

Class Variable Details

xml_element_name

Type:
str
Value:
'x'                                                                    

xml_element_namespace

Type:
str
Value:
'jabber:x:delay'                                                       

Generated by Epydoc 2.1 on Wed May 31 22:36:58 2006 http://epydoc.sf.net