kickmsg*
This commit is contained in:
parent
bf09618d0b
commit
8e3c79c4b9
1 changed files with 17 additions and 13 deletions
18
memos.py
18
memos.py
|
@ -1254,20 +1254,24 @@ class PesterMemo(PesterConvo):
|
||||||
|
|
||||||
# Add ban(kick) reason
|
# Add ban(kick) reason
|
||||||
# l = split update
|
# l = split update
|
||||||
|
kick_msg = ("press 0k to rec0nnect or cancel to absc0nd")
|
||||||
if len(l) >= 3:
|
if len(l) >= 3:
|
||||||
|
try:
|
||||||
if l[1] != l[2]: # If there's no reason then reason is set to handle
|
if l[1] != l[2]: # If there's no reason then reason is set to handle
|
||||||
# Process spare ':' characters (this might not be safe?)
|
# Process spare ':' characters (this might not be safe?)
|
||||||
aggrievocation = l[1] + ": " + l[2]
|
aggrievocation = l[1] + ": " + l[2]
|
||||||
if len(l) > 3:
|
if len(l) > 3:
|
||||||
aggrievocation += ':'
|
aggrievocation += ':'
|
||||||
for x in range(3, len(l)):
|
for x in range(3, len(l)):
|
||||||
aggrievocation += l[x] + ':'
|
aggrievocation += l[x]
|
||||||
aggrievocation = aggrievocation.strip(':')
|
# Not for last slice
|
||||||
msgbox.setInformativeText("%s\n\npress 0k to rec0nnect or cancel to absc0nd" % aggrievocation)
|
if x != (len(l)-1):
|
||||||
else:
|
aggrievocation += ':'
|
||||||
msgbox.setInformativeText("press 0k to rec0nnect or cancel to absc0nd")
|
kick_msg = ("%s\n\npress 0k to rec0nnect or cancel to absc0nd" % aggrievocation)
|
||||||
else:
|
except IndexError as e:
|
||||||
msgbox.setInformativeText("press 0k to rec0nnect or cancel to absc0nd")
|
# This shouldn't happen
|
||||||
|
PchumLog.warning("kickmsg IndexError: %s" % e)
|
||||||
|
msgbox.setInformativeText(kick_msg)
|
||||||
msgbox.setStandardButtons(QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel)
|
msgbox.setStandardButtons(QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel)
|
||||||
# Find the OK button and make it default
|
# Find the OK button and make it default
|
||||||
for b in msgbox.buttons():
|
for b in msgbox.buttons():
|
||||||
|
|
Loading…
Reference in a new issue