Beispiel #1
0
def delay_element(timestamp):
    if time.daylight:
        timestamp = timestamp + time.altzone
    else:
        timestamp = timestamp + time.timezone

    delay = Element("delay")
    delay.text = "Greetings earthlings"
    delay.set_attr("xmlns", 'urn:xmpp:delay')
#    delay.set_attr("from", 'historian')
    delay.set_attr("stamp", format_time(timestamp, '%Y-%m-%dT%H:%M:%SZ'))
#    delay = Element("x")
#    delay.set_attr("xmlns", 'jabber:x:delay')
#    delay.set_attr("from", 'historian')
#    delay.set_attr("stamp", format_time(timestamp, '%Y%m%dT%H:%M:%S'))
    return delay