Compress kick exit dumps into one line

This commit is contained in:
Kiooeht 2011-08-24 00:10:23 -07:00
parent a43bb7b819
commit 3475d464f8
2 changed files with 32 additions and 17 deletions

View file

@ -249,15 +249,28 @@ class PesterProfile(object):
initials = pcf+self.initials()
return "<c=%s><c=%s>%s</c> %s %s %s.</c>" % \
(syscolor.name(), self.colorhtml(), initials, timetext, verb, channel[1:].upper().replace("_", " "))
def memobanmsg(self, opchum, opgrammar, syscolor, timeGrammar, reason):
def memobanmsg(self, opchum, opgrammar, syscolor, initials, reason):
opinit = opgrammar.pcf+opchum.initials()+opgrammar.number
if type(initials) == type(list()):
if opchum.handle == reason:
return "<c=%s>%s</c> banned <c=%s>%s</c> from responding to memo." % \
(opchum.colorhtml(), opinit, self.colorhtml(), ", ".join(initials))
else:
return "<c=%s>%s</c> banned <c=%s>%s</c> from responding to memo: <c=black>[%s]</c>." % \
(opchum.colorhtml(), opinit, self.colorhtml(), ", ".join(initials), unicode(reason))
else:
initials = timeGrammar.pcf+self.initials()+timeGrammar.number
if opchum.handle == reason:
return "<c=%s>%s</c> banned <c=%s>%s</c> from responding to memo." % \
(opchum.colorhtml(), opinit, self.colorhtml(), initials)
else:
return "<c=%s>%s</c> banned <c=%s>%s</c> from responding to memo: <c=black>[%s]</c>." % \
(opchum.colorhtml(), opinit, self.colorhtml(), initials, unicode(reason))
def memopermabanmsg(self, opchum, opgrammar, syscolor, timeGrammar):
initials = timeGrammar.pcf+self.initials()+timeGrammar.number
opinit = opgrammar.pcf+opchum.initials()+opgrammar.number
if opchum.handle == reason:
return "<c=%s>%s</c> banned <c=%s>%s</c> from responding to memo." % \
(opchum.colorhtml(), opinit, self.colorhtml(), initials)
else:
return "<c=%s>%s</c> banned <c=%s>%s</c> from responding to memo: <c=black>[%s]</c>." % \
(opchum.colorhtml(), opinit, self.colorhtml(), initials, unicode(reason))
return "<c=%s>%s</c> permabanned <c=%s>%s</c> from the memo." % \
(opchum.colorhtml(), opinit, self.colorhtml(), initials)
def memojoinmsg(self, syscolor, td, timeGrammar, verb):
(temporal, pcf, when) = (timeGrammar.temporal, timeGrammar.pcf, timeGrammar.when)
timetext = timeDifference(td)

View file

@ -987,19 +987,21 @@ class PesterMemo(PesterConvo):
ttracker = self.times[h]
else:
ttracker = TimeTracker(timedelta(0))
allinitials = []
opchum = PesterProfile(op)
if self.times.has_key(op):
opgrammar = self.times[op].getGrammar()
elif op == self.mainwindow.profile().handle:
opgrammar = self.time.getGrammar()
else:
opgrammar = TimeGrammar("CURRENT", "C", "RIGHT NOW")
while ttracker.getTime() is not None:
grammar = ttracker.getGrammar()
opchum = PesterProfile(op)
if self.times.has_key(op):
opgrammar = self.times[op].getGrammar()
elif op == self.mainwindow.profile().handle:
opgrammar = self.time.getGrammar()
else:
opgrammar = TimeGrammar("CURRENT", "C", "RIGHT NOW")
msg = chum.memobanmsg(opchum, opgrammar, systemColor, grammar, reason)
self.textArea.append(convertTags(msg))
self.mainwindow.chatlog.log(self.channel, msg)
allinitials.append("%s%s%s" % (grammar.pcf, chum.initials(), grammar.number))
ttracker.removeTime(ttracker.getTime())
msg = chum.memobanmsg(opchum, opgrammar, systemColor, allinitials, reason)
self.textArea.append(convertTags(msg))
self.mainwindow.chatlog.log(self.channel, msg)
if chum is self.mainwindow.profile():
# are you next?