From 1f1e5c29c96314618f2a298a211c2457a33f5d98 Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Wed, 18 Jan 2006 10:26:59 +0000 Subject: [PATCH] fix campey's patch readbility and enrich with comments so it is understandable by first look and so maintainable --- src/conversation_textview.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/conversation_textview.py b/src/conversation_textview.py index c667f1f27..926089970 100644 --- a/src/conversation_textview.py +++ b/src/conversation_textview.py @@ -561,14 +561,16 @@ class ConversationTextview(gtk.TextView): if gajim.config.get('print_time') == 'always': before_str = gajim.config.get('before_time') after_str = gajim.config.get('after_time') - # get difference in days since epoch - diff_day = int(timegm(time.localtime()))/86400 - int(timegm(tim))/86400 + # get difference in days since epoch (86400 = 24*3600) + no_of_days_since_epoch = int(timegm(time.localtime())) / 86400 # for GMT time + no_of_days_snce_epoch_for_msg = int(timegm(tim)) / 86400 # for GMT time + diff_day = no_of_days_snce_epoch - no_of_days_snce_epoch_for_msg if diff_day == 0: day_str = '' elif diff_day == 1: day_str = _('Yesterday') else: - #the number is >= 2 + # the number is >= 2 # %i is day in year (1-365), %d (1-31) we want %i day_str = _('%i days ago') % diff_day format = before_str