Do not show seconds in roster tooltips (if today)

Better description of option print_fuzzy
This commit is contained in:
Jean-Marie Traissard 2006-09-26 17:44:29 +00:00
parent c4b8421aef
commit c9d27e163e
2 changed files with 7 additions and 2 deletions

View File

@ -84,7 +84,7 @@ class Config:
'use_speller': [ opt_bool, False, ],
'speller_language': [ opt_str, '', _('Language used by speller')],
'print_time': [ opt_str, 'always', _('\'always\' - print time for every message.\n\'sometimes\' - print time every print_ichat_every_foo_minutes minute.\n\'never\' - never print time.')],
'print_time_fuzzy': [ opt_int, 0, _('Value of fuzziness from 1 to 4 or 0 to disable fuzzyclock. 1 is the most precise clock, 4 the less precise one.') ],
'print_time_fuzzy': [ opt_int, 0, _('Print time in chats using Fuzzy Clock. Value of fuzziness from 1 to 4, or 0 to disable fuzzyclock. 1 is the most precise clock, 4 the less precise one. This is used only if print_time is \'sometimes\'.') ],
'emoticons_theme': [opt_str, 'static', '', True ],
'ascii_formatting': [ opt_bool, True,
_('Treat * / _ pairs as possible formatting characters.'), True],

View File

@ -529,7 +529,12 @@ class RosterTooltip(NotificationAreaTooltip):
if time.strftime('%j', time.localtime())== \
time.strftime('%j', contact.last_status_time):
# it's today, show only the locale hour representation
local_time = time.strftime('%X', contact.last_status_time)
local_time = time.strftime('%X', contact.last_status_time)
# Hack to delete seconds
# We can't use hour:minutes directly because we don't
# know if we should use %H or %I (depend of user locale)
# See http://docs.python.org/lib/module-time.html
local_time = local_time[:-3]
else:
# time.strftime returns locale encoded string
local_time = time.strftime('%c', contact.last_status_time)