gajim does not start up correctly and produces quite some output when started from console, the last lines being:
File "gajim.py", line 432, in handle_event_status
self.roster.on_status_changed(account, status)
File "/usr/share/gajim/src/roster_window.py", line 3038, in on_status_changed
self.chg_contact_status(contact, 'offline', '', account)
File "/usr/share/gajim/src/roster_window.py", line 1203, in chg_contact_status
self.add_contact_to_roster(contact.jid, account)
File "/usr/share/gajim/src/roster_window.py", line 315, in add_contact_to_roster
shown_family)
File "/usr/share/gajim/src/common/contacts.py", line 419, in get_metacontacts_big_brother
score = self._get_data_score(data)
File "/usr/share/gajim/src/common/contacts.py", line 399, in _get_data_score
score = (max_order - order)*10000
TypeError: unsupported operand type(s) for -: 'unicode' and 'unicode'
adding two int-casts to the _get_data_score function in contacts.py seems to fix the problem.
starting at line 382 the code should read:
def _get_data_score(self, data):
'''compute thescore of a gived data
data is {'jid': jid, 'account': account, 'order': order}
order is optional
score = (max_order - order)*10000 + is_jabber*priority*10 + status'''
jid = data['jid']
account = data['account']
max_order = 0
order = 0
if data.has_key('order'):
order = int(data['order']) # added cast here
if order:
family = self.get_metacontacts_family(account, jid)
for data_ in family:
if data_.has_key('order') and data_['order'] > max_order:
max_order = int(data_['order']) # added cast here
contact = self.get_contact_with_highest_priority(account, jid)
score = (max_order - order)*10000
if common.gajim.get_transport_name_from_jid(jid) is None and \
contact.show not in ('error', 'offline'):
score += 10
if contact.priority > 0:
score += contact.priority * 10
score += ['not in roster', 'error', 'offline', 'invisible', 'dnd', 'xa',
'away', 'chat', 'online', 'requested', 'message'].index(contact.show)
if contact.show == 'offline' and contact.status:
# Offline contacts with a status message have highest score
score += 1
return score
Binary package hint: gajim
gajim does not start up correctly and produces quite some output when started from console, the last lines being:
File "gajim.py", line 432, in handle_event_status roster. on_status_ changed( account, status) gajim/src/ roster_ window. py", line 3038, in on_status_changed chg_contact_ status( contact, 'offline', '', account) gajim/src/ roster_ window. py", line 1203, in chg_contact_status add_contact_ to_roster( contact. jid, account) gajim/src/ roster_ window. py", line 315, in add_contact_ to_roster gajim/src/ common/ contacts. py", line 419, in get_metacontact s_big_brother data_score( data) gajim/src/ common/ contacts. py", line 399, in _get_data_score
self.
File "/usr/share/
self.
File "/usr/share/
self.
File "/usr/share/
shown_family)
File "/usr/share/
score = self._get_
File "/usr/share/
score = (max_order - order)*10000
TypeError: unsupported operand type(s) for -: 'unicode' and 'unicode'
adding two int-casts to the _get_data_score function in contacts.py seems to fix the problem.
starting at line 382 the code should read:
def _get_data_ score(self, data): priority* 10 + status''' key('order' ): metacontacts_ family( account, jid) key('order' ) and data_['order'] > max_order: contact_ with_highest_ priority( account, jid)
'''compute thescore of a gived data
data is {'jid': jid, 'account': account, 'order': order}
order is optional
score = (max_order - order)*10000 + is_jabber*
jid = data['jid']
account = data['account']
max_order = 0
order = 0
if data.has_
order = int(data['order']) # added cast here
if order:
family = self.get_
for data_ in family:
if data_.has_
max_order = int(data_['order']) # added cast here
contact = self.get_
score = (max_order - order)*10000
if common. gajim.get_ transport_ name_from_ jid(jid) is None and \ ].index( contact. show)
contact.show not in ('error', 'offline'):
score += 10
if contact.priority > 0:
score += contact.priority * 10
score += ['not in roster', 'error', 'offline', 'invisible', 'dnd', 'xa',
'away', 'chat', 'online', 'requested', 'message'
if contact.show == 'offline' and contact.status:
# Offline contacts with a status message have highest score
score += 1
return score