From 0696e753583643a70cd460d95a4eca477fbc06c6 Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Thu, 3 Nov 2005 21:31:04 +0000 Subject: [PATCH] history order change: history is ordered as everything else latest is in the bottom --- src/common/logger.py | 8 ++++---- src/history_window.py | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/common/logger.py b/src/common/logger.py index a5c4d8a71..839e14123 100644 --- a/src/common/logger.py +++ b/src/common/logger.py @@ -123,8 +123,8 @@ class Logger: return path_to_file def get_no_of_lines(self, fjid): - '''return total number of lines in a log file - return 0 if log file does not exist''' + '''returns total number of lines in a log file + returns 0 if log file does not exist''' fjid = fjid.lower() path_to_file = self.__get_path_to_file(fjid) if not os.path.isfile(path_to_file): @@ -137,8 +137,8 @@ class Logger: return no_of_lines def read(self, fjid, begin_line, end_line): - '''return number of lines read and the text in the lines - return 0 and empty respectively if log file does not exist''' + '''returns number of lines read and the text in the lines + returns 0 and empty string respectively if log file does not exist''' fjid = fjid.lower() path_to_file = self.__get_path_to_file(fjid) if not os.path.isfile(path_to_file): diff --git a/src/history_window.py b/src/history_window.py index d935ee96a..099a8cd31 100644 --- a/src/history_window.py +++ b/src/history_window.py @@ -196,9 +196,9 @@ class HistoryWindow: def new_line(self, date, type, data): '''add a new line in textbuffer''' buff = self.history_buffer - start_iter = buff.get_start_iter() + end_iter = buff.get_end_iter() tim = time.strftime('[%x %X] ', time.localtime(float(date))) - buff.insert(start_iter, tim) + buff.insert(end_iter, tim) name = None tag_name = '' tag_msg = '' @@ -234,8 +234,8 @@ class HistoryWindow: before_str = gajim.config.get('before_nickname') after_str = gajim.config.get('after_nickname') format = before_str + name + after_str + ' ' - buff.insert_with_tags_by_name(start_iter, format, tag_name) + buff.insert_with_tags_by_name(end_iter, format, tag_name) if tag_msg: - buff.insert_with_tags_by_name(start_iter, msg, tag_msg) + buff.insert_with_tags_by_name(end_iter, msg, tag_msg) else: - buff.insert(start_iter, msg) + buff.insert(end_iter, msg)