comparison src/browser/libervia_main.py @ 482:437eefa53a01

misc: remove some pylint errors and warnings
author souliane <souliane@mailoo.org>
date Sun, 15 Jun 2014 18:16:24 +0200
parents 50b286866739
children 0bbbef1d53a8
comparison
equal deleted inserted replaced
481:bbdc5357dc00 482:437eefa53a01
691 self.contact_panel.setContactMessageWaiting(other.bare, True) 691 self.contact_panel.setContactMessageWaiting(other.bare, True)
692 692
693 def _presenceUpdateCb(self, entity, show, priority, statuses): 693 def _presenceUpdateCb(self, entity, show, priority, statuses):
694 entity_jid = jid.JID(entity) 694 entity_jid = jid.JID(entity)
695 if self.whoami and self.whoami == entity_jid: # XXX: QnD way to get our presence/status 695 if self.whoami and self.whoami == entity_jid: # XXX: QnD way to get our presence/status
696 self.status_panel.setPresence(show) 696 assert(isinstance(self.status_panel, panels.PresenceStatusPanel))
697 self.status_panel.setPresence(show) # pylint: disable=E1103
697 if statuses: 698 if statuses:
698 self.status_panel.setStatus(statuses.values()[0]) 699 self.status_panel.setStatus(statuses.values()[0]) # pylint: disable=E1103
699 else: 700 else:
700 self.contact_panel.setConnected(entity_jid.bare, entity_jid.resource, show, priority, statuses) 701 self.contact_panel.setConnected(entity_jid.bare, entity_jid.resource, show, priority, statuses)
701 702
702 def _roomJoinedCb(self, room_jid, room_nicks, user_nick): 703 def _roomJoinedCb(self, room_jid, room_nicks, user_nick):
703 _target = jid.JID(room_jid) 704 _target = jid.JID(room_jid)
799 _dialog.show() 800 _dialog.show()
800 801
801 def _contactDeletedCb(self, entity): 802 def _contactDeletedCb(self, entity):
802 self.contact_panel.removeContact(entity) 803 self.contact_panel.removeContact(entity)
803 804
804 def _newContactCb(self, contact, attributes, groups): 805 def _newContactCb(self, contact_jid, attributes, groups):
805 self.contact_panel.updateContact(contact, attributes, groups) 806 self.contact_panel.updateContact(contact_jid, attributes, groups)
806 807
807 def _entityDataUpdatedCb(self, entity_jid_s, key, value): 808 def _entityDataUpdatedCb(self, entity_jid_s, key, value):
808 if key == "avatar": 809 if key == "avatar":
809 avatar = '/avatars/%s' % value 810 avatar = '/avatars/%s' % value
810 811
890 if type_ in ("PUBLIC", "GROUP"): 891 if type_ in ("PUBLIC", "GROUP"):
891 self.bridge.call("sendMblog", None, type_, entities if type_ == "GROUP" else None, text, extra) 892 self.bridge.call("sendMblog", None, type_, entities if type_ == "GROUP" else None, text, extra)
892 elif type_ == "COMMENT": 893 elif type_ == "COMMENT":
893 self.bridge.call("sendMblogComment", None, entities, text, extra) 894 self.bridge.call("sendMblogComment", None, entities, text, extra)
894 elif type_ == "STATUS": 895 elif type_ == "STATUS":
895 self.bridge.call('setStatus', None, self.status_panel.presence, text) 896 assert(isinstance(self.status_panel, panels.PresenceStatusPanel))
897 self.bridge.call('setStatus', None, self.status_panel.presence, text) # pylint: disable=E1103
896 elif type_ in ("groupchat", "chat"): 898 elif type_ in ("groupchat", "chat"):
897 addresses.append((addr, entities)) 899 addresses.append((addr, entities))
898 else: 900 else:
899 log.error("Unknown target type") 901 log.error("Unknown target type")
900 if addresses: 902 if addresses: