예제 #1
0
    def set_tzo(self, value):
        """
        Set the timezone offset from UTC.

        :param value: Either a tzinfo object or the number of
                      seconds (positive or negative) to offset.
        """
        time = xep_0082.time(offset=value)
        if xep_0082.parse(time).tzinfo == tzutc():
            self._set_sub_text('tzo', 'Z')
        else:
            self._set_sub_text('tzo', time[-6:])
예제 #2
0
파일: stanza.py 프로젝트: budlight/slixmpp
    def set_tzo(self, value):
        """
        Set the timezone offset from UTC.

        Arguments:
            value -- Either a tzinfo object or the number of
                     seconds (positive or negative) to offset.
        """
        time = xep_0082.time(offset=value)
        if xep_0082.parse(time).tzinfo == tzutc():
            self._set_sub_text('tzo', 'Z')
        else:
            self._set_sub_text('tzo', time[-6:])
 def set_tz(self, value):
     time = xep_0082.time(offset=value)
     if time[-1] == 'Z':
         self.xml.text = 'Z'
     else:
         self.xml.text = time[-6:]
예제 #4
0
파일: stanza.py 프로젝트: goutomroy/slixmpp
 def set_tz(self, value):
     time = xep_0082.time(offset=value)
     if time[-1] == 'Z':
         self.xml.text = 'Z'
     else:
         self.xml.text = time[-6:]