history order change: history is ordered as everything else latest is in the bottom
This commit is contained in:
parent
e0d9933b23
commit
0696e75358
|
@ -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):
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue