history order change: history is ordered as everything else latest is in the bottom
This commit is contained in:
parent
e0d9933b23
commit
0696e75358
2 changed files with 9 additions and 9 deletions
|
@ -123,8 +123,8 @@ class Logger:
|
||||||
return path_to_file
|
return path_to_file
|
||||||
|
|
||||||
def get_no_of_lines(self, fjid):
|
def get_no_of_lines(self, fjid):
|
||||||
'''return total number of lines in a log file
|
'''returns total number of lines in a log file
|
||||||
return 0 if log file does not exist'''
|
returns 0 if log file does not exist'''
|
||||||
fjid = fjid.lower()
|
fjid = fjid.lower()
|
||||||
path_to_file = self.__get_path_to_file(fjid)
|
path_to_file = self.__get_path_to_file(fjid)
|
||||||
if not os.path.isfile(path_to_file):
|
if not os.path.isfile(path_to_file):
|
||||||
|
@ -137,8 +137,8 @@ class Logger:
|
||||||
return no_of_lines
|
return no_of_lines
|
||||||
|
|
||||||
def read(self, fjid, begin_line, end_line):
|
def read(self, fjid, begin_line, end_line):
|
||||||
'''return number of lines read and the text in the lines
|
'''returns number of lines read and the text in the lines
|
||||||
return 0 and empty respectively if log file does not exist'''
|
returns 0 and empty string respectively if log file does not exist'''
|
||||||
fjid = fjid.lower()
|
fjid = fjid.lower()
|
||||||
path_to_file = self.__get_path_to_file(fjid)
|
path_to_file = self.__get_path_to_file(fjid)
|
||||||
if not os.path.isfile(path_to_file):
|
if not os.path.isfile(path_to_file):
|
||||||
|
|
|
@ -196,9 +196,9 @@ class HistoryWindow:
|
||||||
def new_line(self, date, type, data):
|
def new_line(self, date, type, data):
|
||||||
'''add a new line in textbuffer'''
|
'''add a new line in textbuffer'''
|
||||||
buff = self.history_buffer
|
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)))
|
tim = time.strftime('[%x %X] ', time.localtime(float(date)))
|
||||||
buff.insert(start_iter, tim)
|
buff.insert(end_iter, tim)
|
||||||
name = None
|
name = None
|
||||||
tag_name = ''
|
tag_name = ''
|
||||||
tag_msg = ''
|
tag_msg = ''
|
||||||
|
@ -234,8 +234,8 @@ class HistoryWindow:
|
||||||
before_str = gajim.config.get('before_nickname')
|
before_str = gajim.config.get('before_nickname')
|
||||||
after_str = gajim.config.get('after_nickname')
|
after_str = gajim.config.get('after_nickname')
|
||||||
format = before_str + name + after_str + ' '
|
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:
|
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:
|
else:
|
||||||
buff.insert(start_iter, msg)
|
buff.insert(end_iter, msg)
|
||||||
|
|
Loading…
Add table
Reference in a new issue