coding standards

This commit is contained in:
Yann Leboulanger 2009-01-28 12:12:13 +00:00
parent 816dc776b0
commit 554764400b
1 changed files with 49 additions and 43 deletions

View File

@ -883,7 +883,6 @@ class GroupchatControl(ChatControlBase):
text, the second, what sound to play.'''
highlight, sound = (None, None)
# Are any of the defined highlighting words in the text?
if self.needs_visual_notification(text):
highlight = True
@ -1013,7 +1012,8 @@ class GroupchatControl(ChatControlBase):
if self.is_anonymous and gc_contact.affiliation not in ['admin', 'owner']\
and self_contact.affiliation in ['admin', 'owner']:
prim_text = _('Really send file?')
sec_text = _('If you send a file to %s, he/she will know your real Jabber ID.') % gc_contact.name
sec_text = _('If you send a file to %s, he/she will know your real '
'Jabber ID.') % gc_contact.name
dialog = dialogs.NonModalConfirmationDialog(prim_text, sec_text,
on_response_ok = (_on_send_files, gc_contact))
dialog.popup()
@ -1044,8 +1044,8 @@ class GroupchatControl(ChatControlBase):
color = gtkgui_helpers._get_fade_color(self.list_treeview,
selected, focus)
colorstring = "#%04x%04x%04x" % (color.red, color.green, color.blue)
name += '\n' '<span size="small" style="italic" foreground="%s">%s</span>'\
% (colorstring, gobject.markup_escape_text(status))
name += '\n<span size="small" style="italic" foreground="%s">%s'
'</span>' % (colorstring, gobject.markup_escape_text(status))
model[iter_][C_IMG] = image
model[iter_][C_TEXT] = name
@ -1505,7 +1505,8 @@ class GroupchatControl(ChatControlBase):
message_array = message_array[0].split()
invitee = message_array.pop(0)
reason = ' '.join(message_array)
gajim.connections[self.account].send_invite(self.room_jid, invitee, reason)
gajim.connections[self.account].send_invite(self.room_jid, invitee,
reason)
s = _('Invited %(contact_jid)s to %(room_jid)s.') % {
'contact_jid': invitee,
'room_jid': self.room_jid}
@ -1519,7 +1520,8 @@ class GroupchatControl(ChatControlBase):
if len(message_array):
room_jid = message_array[0]
if room_jid.find('@') < 0:
room_jid = room_jid + '@' + gajim.get_server_from_jid(self.room_jid)
room_jid = room_jid + '@' + gajim.get_server_from_jid(
self.room_jid)
else:
room_jid = '@' + gajim.get_server_from_jid(self.room_jid)
if room_jid.find('/') >= 0:
@ -1641,9 +1643,9 @@ class GroupchatControl(ChatControlBase):
self.print_conversation(_('Commands: %s') % GroupchatControl.MUC_CMDS,
'info')
elif command == 'ban':
s = _('Usage: /%s <nickname|JID> [reason], bans the JID from the group chat.'
' The nickname of an occupant may be substituted, but not if it '
'contains "@". If the JID is currently in the group chat, '
s = _('Usage: /%s <nickname|JID> [reason], bans the JID from the group'
' chat. The nickname of an occupant may be substituted, but not if '
'it contains "@". If the JID is currently in the group chat, '
'he/she/it will also be kicked. Does NOT support spaces in '
'nickname.') % command
self.print_conversation(s, 'info')
@ -1773,7 +1775,8 @@ class GroupchatControl(ChatControlBase):
fjid = self.room_jid + '/' + nick
ctrl = gajim.interface.msg_win_mgr.get_gc_control(fjid, self.account)
if ctrl:
contact = gajim.contacts.get_gc_contact(self.account, self.room_jid, nick)
contact = gajim.contacts.get_gc_contact(self.account, self.room_jid,
nick)
contact.show = 'offline'
contact.status = ''
ctrl.update_ui()
@ -1876,7 +1879,8 @@ class GroupchatControl(ChatControlBase):
if c.affiliation == 'owner':
gajim.connections[self.account].request_gc_config(self.room_jid)
elif c.affiliation == 'admin':
if self.room_jid not in gajim.interface.instances[self.account]['gc_config']:
if self.room_jid not in gajim.interface.instances[self.account][
'gc_config']:
gajim.interface.instances[self.account]['gc_config'][self.room_jid]\
= config.GroupchatConfigWindow(self.account, self.room_jid)
@ -2330,7 +2334,6 @@ class GroupchatControl(ChatControlBase):
else:
self.tooltip.hide_tooltip()
def grant_voice(self, widget, nick):
'''grant voice privilege to a user'''
gajim.connections[self.account].gc_set_role(self.room_jid, nick,
@ -2375,7 +2378,8 @@ class GroupchatControl(ChatControlBase):
def grant_admin(self, widget, jid):
'''grant administrative privilege to a user'''
gajim.connections[self.account].gc_set_affiliation(self.room_jid, jid, 'admin')
gajim.connections[self.account].gc_set_affiliation(self.room_jid, jid,
'admin')
def revoke_admin(self, widget, jid):
'''revoke administrative privilege to a user'''
@ -2384,11 +2388,13 @@ class GroupchatControl(ChatControlBase):
def grant_owner(self, widget, jid):
'''grant owner privilege to a user'''
gajim.connections[self.account].gc_set_affiliation(self.room_jid, jid, 'owner')
gajim.connections[self.account].gc_set_affiliation(self.room_jid, jid,
'owner')
def revoke_owner(self, widget, jid):
'''revoke owner privilege to a user'''
gajim.connections[self.account].gc_set_affiliation(self.room_jid, jid, 'admin')
gajim.connections[self.account].gc_set_affiliation(self.room_jid, jid,
'admin')
def on_info(self, widget, nick):
'''Call vcard_information_window class to display user's information'''