fix indentation

This commit is contained in:
Yann Leboulanger 2013-02-21 19:20:41 +01:00
parent 53e46223be
commit ee6cc3358c

View file

@ -258,7 +258,8 @@ class HistoryWindow:
""" """
if jid_or_name and jid_or_name in self.completion_dict: if jid_or_name and jid_or_name in self.completion_dict:
# a full qualified jid or a contact name was entered # a full qualified jid or a contact name was entered
info_jid, info_account, info_name, info_completion = self.completion_dict[jid_or_name] info_jid, info_account, info_name, info_completion = \
self.completion_dict[jid_or_name]
self.jids_to_search = [info_jid] self.jids_to_search = [info_jid]
self.jid = info_jid self.jid = info_jid
@ -290,8 +291,8 @@ class HistoryWindow:
# select logs for last date we have logs with contact # select logs for last date we have logs with contact
self.calendar.set_sensitive(True) self.calendar.set_sensitive(True)
last_log = \ last_log = gajim.logger.get_last_date_that_has_logs(self.jid,
gajim.logger.get_last_date_that_has_logs(self.jid, self.account) self.account)
date = time.localtime(last_log) date = time.localtime(last_log)
@ -381,7 +382,8 @@ class HistoryWindow:
self.history_buffer.set_text('') # clear the buffer first self.history_buffer.set_text('') # clear the buffer first
self.last_time_printout = 0 self.last_time_printout = 0
lines = gajim.logger.get_conversation_for_date(self.jid, year, month, day, self.account) lines = gajim.logger.get_conversation_for_date(self.jid, year, month,
day, self.account)
# lines holds list with tupples that have: # lines holds list with tupples that have:
# contact_name, time, kind, show, message # contact_name, time, kind, show, message
for line in lines: for line in lines:
@ -445,8 +447,8 @@ class HistoryWindow:
{'nick': contact_name, 'status': helpers.get_uf_show(show), {'nick': contact_name, 'status': helpers.get_uf_show(show),
'status_msg': message } 'status_msg': message }
else: else:
message = _('%(nick)s is now %(status)s') % {'nick': contact_name, message = _('%(nick)s is now %(status)s') % {
'status': helpers.get_uf_show(show) } 'nick': contact_name, 'status': helpers.get_uf_show(show) }
tag_msg = 'status' tag_msg = 'status'
else: # 'status' else: # 'status'
# message here (if not None) is status message # message here (if not None) is status message
@ -506,10 +508,11 @@ class HistoryWindow:
for jid in self.jids_to_search: for jid in self.jids_to_search:
account = self.completion_dict[jid][C_INFO_ACCOUNT] account = self.completion_dict[jid][C_INFO_ACCOUNT]
if account is None: if account is None:
# We do not know an account. This can only happen if the contact is offine, # We do not know an account. This can only happen if the contact
# or if we browse a groupchat history. The account is not needed, a dummy can # is offine, or if we browse a groupchat history. The account is
# be set. # not needed, a dummy can be set.
# This may leed to wrong self nick in the displayed history (Uggh!) # This may leed to wrong self nick in the displayed history
# (Uggh!)
account = gajim.contacts.get_accounts()[0] account = gajim.contacts.get_accounts()[0]
year, month, day = False, False, False year, month, day = False, False, False
@ -518,8 +521,8 @@ class HistoryWindow:
month = gtkgui_helpers.make_gtk_month_python_month(month) month = gtkgui_helpers.make_gtk_month_python_month(month)
# contact_name, time, kind, show, message, subject # contact_name, time, kind, show, message, subject
results = gajim.logger.get_search_results_for_query( results = gajim.logger.get_search_results_for_query(jid, text,
jid, text, account, year, month, day) account, year, month, day)
#FIXME: #FIXME:
# add "subject: | message: " in message column if kind is single # add "subject: | message: " in message column if kind is single
# also do we need show at all? (we do not search on subject) # also do we need show at all? (we do not search on subject)
@ -609,7 +612,8 @@ class HistoryWindow:
None) None)
if result is not None: if result is not None:
match_start_iter, match_end_iter = result match_start_iter, match_end_iter = result
match_start_iter.backward_char() # include '[' or other character before time # include '[' or other character before time
match_start_iter.backward_char()
match_end_iter.forward_line() # highlight all message not just time match_end_iter.forward_line() # highlight all message not just time
self.history_buffer.apply_tag_by_name('highlight', match_start_iter, self.history_buffer.apply_tag_by_name('highlight', match_start_iter,
match_end_iter) match_end_iter)