Changeset 8699 for branches/gajim_0.11.1/src/common
- Timestamp:
- 09/03/07 11:07:03 (15 months ago)
- Location:
- branches/gajim_0.11.1/src/common
- Files:
-
- 3 modified
-
connection_handlers.py (modified) (3 diffs)
-
helpers.py (modified) (1 diff)
-
zeroconf/connection_handlers_zeroconf.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/gajim_0.11.1/src/common/connection_handlers.py
r8673 r8699 25 25 26 26 from time import (altzone, daylight, gmtime, localtime, mktime, strftime, 27 strptime,time as time_time, timezone, tzname)27 time as time_time, timezone, tzname) 28 28 from calendar import timegm 29 29 … … 1386 1386 subject = msg.getSubject() # if not there, it's None 1387 1387 tim = msg.getTimestamp() 1388 tim = strptime(tim, '%Y%m%dT%H:%M:%S')1388 tim = helpers.datetime_tuple(tim) 1389 1389 tim = localtime(timegm(tim)) 1390 1390 frm = helpers.get_full_jid_from_iq(msg) … … 1586 1586 # XEP-0091 1587 1587 tim = prs.getTimestamp() 1588 tim = strptime(tim, '%Y%m%dT%H:%M:%S')1588 tim = helpers.datetime_tuple(tim) 1589 1589 timestamp = localtime(timegm(tim)) 1590 1590 if namespace == 'http://delx.cjb.net/protocol/roster-subsync': -
branches/gajim_0.11.1/src/common/helpers.py
r8681 r8699 947 947 'show': status, 'message': message}) 948 948 return accounts 949 950 def datetime_tuple(timestamp): 951 '''Converts timestamp using strptime and the format: %Y%m%dT%H:%M:%S 952 Because of various datetime formats are used the following exceptions 953 are handled: 954 - Optional milliseconds appened to the string are removed 955 - XEP-082 datetime strings have all '-' cahrs removed to meet 956 the above format.''' 957 timestamp = timestamp.split('.')[0] 958 timestamp = timestamp.replace('-', '') 959 from time import strptime 960 return strptime(timestamp, '%Y%m%dT%H:%M:%S') -
branches/gajim_0.11.1/src/common/zeroconf/connection_handlers_zeroconf.py
r8683 r8699 629 629 subject = msg.getSubject() # if not there, it's None 630 630 tim = msg.getTimestamp() 631 tim = time.strptime(tim, '%Y%m%dT%H:%M:%S')631 tim = helpers.datetime_tuple(tim) 632 632 tim = time.localtime(timegm(tim)) 633 633 frm = msg.getFrom()
