diff frontends/src/wix/chat.py @ 812:084b52afdceb

frontends: fixed /me usage + renamed a couple of "type" parameters to type_
author Goffi <goffi@goffi.org>
date Tue, 04 Feb 2014 18:51:16 +0100
parents 1fe00f0c9a91
children cd02f5ef30df
line wrap: on
line diff
--- a/frontends/src/wix/chat.py	Tue Feb 04 18:32:49 2014 +0100
+++ b/frontends/src/wix/chat.py	Tue Feb 04 18:51:16 2014 +0100
@@ -38,9 +38,9 @@
 class Chat(wx.Frame, QuickChat):
     """The chat Window for one to one conversations"""
 
-    def __init__(self, target, host, type='one2one'):
+    def __init__(self, target, host, type_='one2one'):
         wx.Frame.__init__(self, None, title=target, pos=(0,0), size=(400,200))
-        QuickChat.__init__(self, target, host, type)
+        QuickChat.__init__(self, target, host, type_)
 
         self.sizer = wx.BoxSizer(wx.VERTICAL)
         self.SetSizer(self.sizer)
@@ -80,21 +80,21 @@
         """Create a list of present people in a group chat"""
         self.present_panel = wx.Panel(self.splitter)
         self.present_panel.sizer = wx.BoxSizer(wx.VERTICAL)
-        self.present_panel.presents = ContactList(self.present_panel, self.host, type='nicks')
+        self.present_panel.presents = ContactList(self.present_panel, self.host, type_='nicks')
         self.present_panel.presents.SetMinSize(wx.Size(80,20))
         self.present_panel.sizer.Add(self.present_panel.presents, 1, wx.EXPAND)
         self.present_panel.SetSizer(self.present_panel.sizer)
         self.splitter.SplitVertically(self.present_panel, self.conv_panel, 80)
 
-    def setType(self, type):
-        QuickChat.setType(self, type)
-        if type is 'group' and not self.splitter.IsSplit():
+    def setType(self, type_):
+        QuickChat.setType(self, type_)
+        if type_ is 'group' and not self.splitter.IsSplit():
             self.__createPresents()
             self.subjectBox.Show()
             self.__eraseMenus()
             self.__createMenus_group()
             self.sizer.Layout()
-        elif type is 'one2one' and self.splitter.IsSplit():
+        elif type_ is 'one2one' and self.splitter.IsSplit():
             self.splitter.Unsplit(self.present_panel)
             del self.present_panel
             self.GetMenuBar().Show()
@@ -236,18 +236,18 @@
         if not mymess:
             self.__blink()
 
-    def printInfo(self, msg, type='normal'):
+    def printInfo(self, msg, type_='normal'):
         """Print general info
         @param msg: message to print
-        @type: one of:
+        @type_: one of:
             normal: general info like "toto has joined the room"
             me: "/me" information like "/me clenches his fist" ==> "toto clenches his fist"
         """
         _font_bold = wx.Font(self.font["points"], self.font["family"], wx.NORMAL, wx.BOLD)
         _font_normal = wx.Font(self.font["points"], self.font["family"], wx.NORMAL, wx.NORMAL)
-        self.chatWindow.SetDefaultStyle(wx.TextAttr("BLACK", font=_font_bold if type == 'normal' else _font_normal))
+        self.chatWindow.SetDefaultStyle(wx.TextAttr("BLACK", font=_font_bold if type_ == 'normal' else _font_normal))
         self.chatWindow.AppendText("%s\n" % msg)
-        if type=="me":
+        if type_=="me":
             self.__blink()
 
     ### events ###