Ejemplo n.º 1
0
    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:])
Ejemplo n.º 2
0
    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:])
Ejemplo n.º 3
0
 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:]
Ejemplo n.º 4
0
 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:]