Compress kick exit dumps into one line
This commit is contained in:
parent
a43bb7b819
commit
3475d464f8
2 changed files with 32 additions and 17 deletions
17
dataobjs.py
17
dataobjs.py
|
@ -249,15 +249,28 @@ class PesterProfile(object):
|
||||||
initials = pcf+self.initials()
|
initials = pcf+self.initials()
|
||||||
return "<c=%s><c=%s>%s</c> %s %s %s.</c>" % \
|
return "<c=%s><c=%s>%s</c> %s %s %s.</c>" % \
|
||||||
(syscolor.name(), self.colorhtml(), initials, timetext, verb, channel[1:].upper().replace("_", " "))
|
(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):
|
||||||
initials = timeGrammar.pcf+self.initials()+timeGrammar.number
|
|
||||||
opinit = opgrammar.pcf+opchum.initials()+opgrammar.number
|
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:
|
if opchum.handle == reason:
|
||||||
return "<c=%s>%s</c> banned <c=%s>%s</c> from responding to memo." % \
|
return "<c=%s>%s</c> banned <c=%s>%s</c> from responding to memo." % \
|
||||||
(opchum.colorhtml(), opinit, self.colorhtml(), initials)
|
(opchum.colorhtml(), opinit, self.colorhtml(), initials)
|
||||||
else:
|
else:
|
||||||
return "<c=%s>%s</c> banned <c=%s>%s</c> from responding to memo: <c=black>[%s]</c>." % \
|
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))
|
(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
|
||||||
|
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):
|
def memojoinmsg(self, syscolor, td, timeGrammar, verb):
|
||||||
(temporal, pcf, when) = (timeGrammar.temporal, timeGrammar.pcf, timeGrammar.when)
|
(temporal, pcf, when) = (timeGrammar.temporal, timeGrammar.pcf, timeGrammar.when)
|
||||||
timetext = timeDifference(td)
|
timetext = timeDifference(td)
|
||||||
|
|
10
memos.py
10
memos.py
|
@ -987,8 +987,7 @@ class PesterMemo(PesterConvo):
|
||||||
ttracker = self.times[h]
|
ttracker = self.times[h]
|
||||||
else:
|
else:
|
||||||
ttracker = TimeTracker(timedelta(0))
|
ttracker = TimeTracker(timedelta(0))
|
||||||
while ttracker.getTime() is not None:
|
allinitials = []
|
||||||
grammar = ttracker.getGrammar()
|
|
||||||
opchum = PesterProfile(op)
|
opchum = PesterProfile(op)
|
||||||
if self.times.has_key(op):
|
if self.times.has_key(op):
|
||||||
opgrammar = self.times[op].getGrammar()
|
opgrammar = self.times[op].getGrammar()
|
||||||
|
@ -996,10 +995,13 @@ class PesterMemo(PesterConvo):
|
||||||
opgrammar = self.time.getGrammar()
|
opgrammar = self.time.getGrammar()
|
||||||
else:
|
else:
|
||||||
opgrammar = TimeGrammar("CURRENT", "C", "RIGHT NOW")
|
opgrammar = TimeGrammar("CURRENT", "C", "RIGHT NOW")
|
||||||
msg = chum.memobanmsg(opchum, opgrammar, systemColor, grammar, reason)
|
while ttracker.getTime() is not None:
|
||||||
|
grammar = ttracker.getGrammar()
|
||||||
|
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.textArea.append(convertTags(msg))
|
||||||
self.mainwindow.chatlog.log(self.channel, msg)
|
self.mainwindow.chatlog.log(self.channel, msg)
|
||||||
ttracker.removeTime(ttracker.getTime())
|
|
||||||
|
|
||||||
if chum is self.mainwindow.profile():
|
if chum is self.mainwindow.profile():
|
||||||
# are you next?
|
# are you next?
|
||||||
|
|
Loading…
Reference in a new issue