Remove trailing whitespaces.
This commit is contained in:
parent
310e2cc347
commit
27b3592e16
1 changed files with 899 additions and 899 deletions
|
|
@ -25,7 +25,7 @@ from sat_frontends.quick_frontend.quick_utils import unescapePrivate
|
|||
|
||||
|
||||
class QuickChat():
|
||||
|
||||
|
||||
def __init__(self, target, host, type='one2one'):
|
||||
self.target = target
|
||||
self.host = host
|
||||
|
|
@ -49,7 +49,7 @@ class QuickChat():
|
|||
error (_("[INTERNAL] trying to set presents nicks for a non group chat window"))
|
||||
raise Exception("INTERNAL ERROR") #TODO: raise proper Exception here
|
||||
self.occupants.update(nicks)
|
||||
|
||||
|
||||
def replaceUser(self, nick, show_info=True):
|
||||
"""Add user if it is not in the group list"""
|
||||
debug (_("Replacing user %s") % nick)
|
||||
|
|
@ -77,7 +77,7 @@ class QuickChat():
|
|||
|
||||
def getUserNick(self):
|
||||
return unicode(self.nick)
|
||||
|
||||
|
||||
def changeUserNick(self, old_nick, new_nick):
|
||||
"""Change nick of a user in group list"""
|
||||
debug(_("Changing nick of user %(old_nick)s to %(new_nick)s") % {"old_nick": old_nick, "new_nick": new_nick})
|
||||
|
|
@ -99,13 +99,13 @@ class QuickChat():
|
|||
"""Print the initial history"""
|
||||
debug (_("now we print history"))
|
||||
def onHistory(history):
|
||||
for line in history:
|
||||
for line in history:
|
||||
timestamp, from_jid, to_jid, message, _type = line
|
||||
if ((self.type == 'group' and _type != 'groupchat') or
|
||||
(self.type == 'one2one' and _type == 'groupchat')):
|
||||
continue
|
||||
self.printMessage(JID(from_jid), message, profile, timestamp)
|
||||
|
||||
|
||||
def onHistoryError(err):
|
||||
error (_("Can't get history"))
|
||||
|
||||
|
|
@ -123,11 +123,11 @@ class QuickChat():
|
|||
if jid.startswith(const_PRIVATE_PREFIX) or unescaped.short == jid.short:
|
||||
return unescaped.resource
|
||||
return jid.resource if self.type == "group" else (self.host.contact_list.getCache(jid,'nick') or self.host.contact_list.getCache(jid,'name') or jid.node)
|
||||
|
||||
|
||||
def printMessage(self, from_jid, msg, profile, timestamp = ''):
|
||||
"""Print message in chat window. Must be implemented by child class"""
|
||||
jid=JID(from_jid)
|
||||
nick = self._get_nick(jid)
|
||||
nick = self._get_nick(jid)
|
||||
mymess = (jid.resource == self.nick) if self.type == "group" else (jid.short == self.host.profiles[profile]['whoami'].short) #mymess = True if message comes from local user
|
||||
if msg.startswith('/me '):
|
||||
self.printInfo('* %s %s' % (nick, msg[4:]),type='me', timestamp=timestamp)
|
||||
|
|
@ -143,12 +143,12 @@ class QuickChat():
|
|||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
|
||||
def startGame(self, game_type, referee, players):
|
||||
"""Configure the chat window to start a game"""
|
||||
#No need to raise an error as game are not mandatory
|
||||
warning(_('startGame is not implemented in this frontend'))
|
||||
|
||||
|
||||
def getGame(self, game_type):
|
||||
"""Return class managing the game type"""
|
||||
#No need to raise an error as game are not mandatory
|
||||
|
|
|
|||
Loading…
Reference in a new issue