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

# Class Delay

source code

                     object --+
                              |
    objects.StanzaPayloadObject --+
                                  |
                                 Delay

Delayed delivery tag.

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

Instance Methods | [hide private]
__init__(self, node_or_datetime, delay_from=None, reason=None, utc=True) Initialize the Delay object. | source code
from_xml(self, xmlnode) Initialize Delay object from an XML node. | source code
complete_xml_element(self, xmlnode, _unused) Complete the XML node with `self` content. | source code
`datetime.datetime` |
get_datetime_local(self) Get the timestamp as a local time. | source code
`datetime.datetime` |
get_datetime_utc(self) Get the timestamp as a UTC. | source code
__str__(self) str(x) | source code
__cmp__(self, other) | source code
Inherited from `objects.StanzaPayloadObject`: `as_xml` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Class Variables | [hide private]
`unicode` | xml_element_name = ``'``x``'`` name for the XML element provided by the class.
`unicode` | xml_element_namespace = ``'``jabber:x:delay``'`` namespace URI for the XML element provided by the class.

Instance Variables | [hide private]
| 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

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

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

### from_xml(self, xmlnode) | source code
Initialize Delay object from an XML node. Parameters: `xmlnode` (`libxml2.xmlNode`) - the jabber:x:delay XML element.

### complete_xml_element(self, xmlnode, _unused) | source code
Complete the XML node with `self` content. Should be overriden in classes derived from StanzaPayloadObject. Parameters: `xmlnode` (`libxml2.xmlNode`) - XML node with the element being built. It has already right name and namespace, but no attributes or content. `_unused` (`libxml2.xmlDoc`) - document to which the element belongs. Overrides: objects.StanzaPayloadObject.complete_xml_element

### get_datetime_local(self) | source code
Get the timestamp as a local time. Returns: `datetime.datetime` the timestamp of the delay element represented in the local timezone.

### get_datetime_utc(self) | source code
Get the timestamp as a UTC. Returns: `datetime.datetime` the timestamp of the delay element represented in UTC.

### __str__(self) (Informal representation operator) | source code
str(x) Overrides: object.__str__ (inherited documentation)