This commit is contained in:
Stephen Dranger 2011-02-07 12:40:05 -06:00
parent 6fcbf3aaf0
commit e39590d60b
16 changed files with 119 additions and 57 deletions

6
TODO
View file

@ -1,14 +1,14 @@
Features: Features:
* dropped messages when chatting
* X closes to tray * X closes to tray
* color text is not being translated to server? * color text is not being translated to server?
* convo backgrounds -- make them more like http://www.mspaintadventures.com/storyfiles/hs2/02546_2.gif * convo backgrounds -- make them more like http://www.mspaintadventures.com/storyfiles/hs2/02546_2.gif
* PESTERLOG: in convo window
* make other ppl ops * make other ppl ops
* turn off sound option!!
* help button on quirks menu? * help button on quirks menu?
* tab recombining gives wrong window icon
* help menu -- about and forum * help menu -- about and forum
-- release alpha -- release alpha
* scroll bar style * scroll bar style?
* User commands/stop user from sending commands accidentally * User commands/stop user from sending commands accidentally
* shared buddy lists - changes to the buddy list should refresh it? * shared buddy lists - changes to the buddy list should refresh it?
multiple clients share buddy list??? multiple clients share buddy list???

View file

@ -127,12 +127,12 @@ class PesterTabWindow(QtGui.QFrame):
self.mainwindow.waitingMessages.messageAnswered(handle) self.mainwindow.waitingMessages.messageAnswered(handle)
def initTheme(self, convo): def initTheme(self, convo):
self.resize(*convo["size"]) self.resize(*convo["size"])
self.setStyleSheet(convo["style"]) self.setStyleSheet(convo["tabs"]["style"])
self.tabs.setShape(convo["tabs"]["tabstyle"]) self.tabs.setShape(convo["tabs"]["tabstyle"])
self.tabs.setStyleSheet("QTabBar::tab{ %s } QTabBar::tab:selected { %s }" % (convo["tabs"]["style"], convo["tabs"]["selectedstyle"])) self.tabs.setStyleSheet("QTabBar::tab{ %s } QTabBar::tab:selected { %s }" % (convo["tabs"]["style"], convo["tabs"]["selectedstyle"]))
def changeTheme(self, theme): def changeTheme(self, theme):
self.initTheme(theme["memos"]) self.initTheme(theme["convo"])
for c in self.convos.values(): for c in self.convos.values():
tabi = self.tabIndices[c.title()] tabi = self.tabIndices[c.title()]
self.tabs.setTabIcon(tabi, c.icon()) self.tabs.setTabIcon(tabi, c.icon())

BIN
convo.pyc

Binary file not shown.

58
irc.py
View file

@ -4,6 +4,7 @@ from oyoyo.cmdhandler import DefaultCommandHandler
from oyoyo import helpers from oyoyo import helpers
import logging import logging
import random import random
import socket
from dataobjs import Mood, PesterProfile from dataobjs import Mood, PesterProfile
from generic import PesterList from generic import PesterList
@ -19,72 +20,111 @@ class PesterIRC(QtCore.QObject):
self.cli.command_handler.parent = self self.cli.command_handler.parent = self
self.cli.command_handler.mainwindow = self.mainwindow self.cli.command_handler.mainwindow = self.mainwindow
self.conn = self.cli.connect() self.conn = self.cli.connect()
self.brokenConnection = False
def setConnectionBroken(self):
self.brokenConnection = True
@QtCore.pyqtSlot(PesterProfile) @QtCore.pyqtSlot(PesterProfile)
def getMood(self, *chums): def getMood(self, *chums):
self.cli.command_handler.getMood(*chums) self.cli.command_handler.getMood(*chums)
@QtCore.pyqtSlot(PesterList) @QtCore.pyqtSlot(PesterList)
def getMoods(self, chums): def getMoods(self, chums):
self.cli.command_handler.getMood(*chums) self.cli.command_handler.getMood(*chums)
@QtCore.pyqtSlot(QtCore.QString, QtCore.QString) @QtCore.pyqtSlot(QtCore.QString, QtCore.QString)
def sendMessage(self, text, handle): def sendMessage(self, text, handle):
h = unicode(handle) h = unicode(handle)
try:
helpers.msg(self.cli, h, text) helpers.msg(self.cli, h, text)
except socket.error:
self.setConnectionBroken()
@QtCore.pyqtSlot(QtCore.QString, bool) @QtCore.pyqtSlot(QtCore.QString, bool)
def startConvo(self, handle, initiated): def startConvo(self, handle, initiated):
h = unicode(handle) h = unicode(handle)
try:
if initiated: if initiated:
helpers.msg(self.cli, h, "PESTERCHUM:BEGIN") helpers.msg(self.cli, h, "PESTERCHUM:BEGIN")
helpers.msg(self.cli, h, "COLOR >%s" % (self.mainwindow.profile().colorcmd())) helpers.msg(self.cli, h, "COLOR >%s" % (self.mainwindow.profile().colorcmd()))
except socket.error:
self.setConnectionBroken()
@QtCore.pyqtSlot(QtCore.QString) @QtCore.pyqtSlot(QtCore.QString)
def endConvo(self, handle): def endConvo(self, handle):
h = unicode(handle) h = unicode(handle)
try:
helpers.msg(self.cli, h, "PESTERCHUM:CEASE") helpers.msg(self.cli, h, "PESTERCHUM:CEASE")
except socket.error:
self.setConnectionBroken()
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def updateProfile(self): def updateProfile(self):
me = self.mainwindow.profile() me = self.mainwindow.profile()
handle = me.handle handle = me.handle
try:
helpers.nick(self.cli, handle) helpers.nick(self.cli, handle)
except socket.error:
self.setConnectionBroken()
self.updateMood() self.updateMood()
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def updateMood(self): def updateMood(self):
me = self.mainwindow.profile() me = self.mainwindow.profile()
try:
helpers.msg(self.cli, "#pesterchum", "MOOD >%d" % (me.mood.value())) helpers.msg(self.cli, "#pesterchum", "MOOD >%d" % (me.mood.value()))
except socket.error:
self.setConnectionBroken()
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def updateColor(self): def updateColor(self):
me = self.mainwindow.profile() me = self.mainwindow.profile()
for h in self.mainwindow.convos.keys(): for h in self.mainwindow.convos.keys():
try:
helpers.msg(self.cli, h, "COLOR >%s" % (self.mainwindow.profile().colorcmd())) helpers.msg(self.cli, h, "COLOR >%s" % (self.mainwindow.profile().colorcmd()))
except socket.error:
self.setConnectionBroken()
@QtCore.pyqtSlot(QtCore.QString) @QtCore.pyqtSlot(QtCore.QString)
def blockedChum(self, handle): def blockedChum(self, handle):
h = unicode(handle) h = unicode(handle)
try:
helpers.msg(self.cli, h, "PESTERCHUM:BLOCK") helpers.msg(self.cli, h, "PESTERCHUM:BLOCK")
except socket.error:
self.setConnectionBroken()
@QtCore.pyqtSlot(QtCore.QString) @QtCore.pyqtSlot(QtCore.QString)
def unblockedChum(self, handle): def unblockedChum(self, handle):
h = unicode(handle) h = unicode(handle)
try:
helpers.msg(self.cli, h, "PESTERCHUM:UNBLOCK") helpers.msg(self.cli, h, "PESTERCHUM:UNBLOCK")
except socket.error:
self.setConnectionBroken()
@QtCore.pyqtSlot(QtCore.QString) @QtCore.pyqtSlot(QtCore.QString)
def requestNames(self, channel): def requestNames(self, channel):
c = unicode(channel) c = unicode(channel)
try:
helpers.names(self.cli, c) helpers.names(self.cli, c)
except socket.error:
self.setConnectionBroken()
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def requestChannelList(self): def requestChannelList(self):
try:
helpers.channel_list(self.cli) helpers.channel_list(self.cli)
except socket.error:
self.setConnectionBroken()
@QtCore.pyqtSlot(QtCore.QString) @QtCore.pyqtSlot(QtCore.QString)
def joinChannel(self, channel): def joinChannel(self, channel):
c = unicode(channel) c = unicode(channel)
try:
helpers.join(self.cli, c) helpers.join(self.cli, c)
except socket.error:
self.setConnectionBroken()
@QtCore.pyqtSlot(QtCore.QString) @QtCore.pyqtSlot(QtCore.QString)
def leftChannel(self, channel): def leftChannel(self, channel):
c = unicode(channel) c = unicode(channel)
try:
helpers.part(self.cli, c) helpers.part(self.cli, c)
except socket.error:
self.setConnectionBroken()
@QtCore.pyqtSlot(QtCore.QString, QtCore.QString) @QtCore.pyqtSlot(QtCore.QString, QtCore.QString)
def kickUser(self, handle, channel): def kickUser(self, handle, channel):
c = unicode(channel) c = unicode(channel)
h = unicode(handle) h = unicode(handle)
try:
helpers.kick(self.cli, h, c) helpers.kick(self.cli, h, c)
except socket.error:
self.setConnectionBroken()
@QtCore.pyqtSlot(QtCore.QString, QtCore.QString, QtCore.QString) @QtCore.pyqtSlot(QtCore.QString, QtCore.QString, QtCore.QString)
def setChannelMode(self, channel, mode, command): def setChannelMode(self, channel, mode, command):
c = unicode(channel) c = unicode(channel)
@ -92,7 +132,10 @@ class PesterIRC(QtCore.QObject):
cmd = unicode(command) cmd = unicode(command)
if cmd == "": if cmd == "":
cmd = None cmd = None
try:
helpers.mode(self.cli, c, m, cmd) helpers.mode(self.cli, c, m, cmd)
except socket.error:
self.setConnectionBroken()
def updateIRC(self): def updateIRC(self):
self.conn.next() self.conn.next()
@ -112,6 +155,8 @@ class PesterIRC(QtCore.QObject):
class PesterHandler(DefaultCommandHandler): class PesterHandler(DefaultCommandHandler):
def privmsg(self, nick, chan, msg): def privmsg(self, nick, chan, msg):
# display msg, do other stuff # display msg, do other stuff
if len(msg) == 0:
return
# silently ignore CTCP # silently ignore CTCP
if msg[0] == '\x01': if msg[0] == '\x01':
return return
@ -223,8 +268,15 @@ class PesterHandler(DefaultCommandHandler):
for c in chums: for c in chums:
chandle = c.handle chandle = c.handle
if len(chumglub+chandle) >= 350: if len(chumglub+chandle) >= 350:
try:
helpers.msg(self.client, "#pesterchum", chumglub) helpers.msg(self.client, "#pesterchum", chumglub)
except socket.error:
self.parent.setConnectionBroken()
chumglub = "GETMOOD " chumglub = "GETMOOD "
chumglub += chandle chumglub += chandle
if chumglub != "GETMOOD ": if chumglub != "GETMOOD ":
try:
helpers.msg(self.client, "#pesterchum", chumglub) helpers.msg(self.client, "#pesterchum", chumglub)
except socket.error:
self.parent.setConnectionBroken()

BIN
irc.pyc

Binary file not shown.

View file

@ -1 +1 @@
{"macruralAlchemist": {"color": "#700000", "handle": "macruralAlchemist", "mood": "offline"}, "fireSwallow": {"color": "#80bb9a", "handle": "fireSwallow", "mood": "offline"}, "aquaMarinist": {"color": "#00caca", "handle": "aquaMarinist", "mood": "offline"}, "nitroZealist": {"color": "#ff3737", "handle": "nitroZealist", "mood": "offline"}, "mechanicalSpectacle": {"color": "#000000", "handle": "mechanicalSpectacle", "mood": "offline"}, "caffeinatedAnalyst": {"color": "#aa0000", "handle": "caffeinatedAnalyst", "mood": "offline"}, "iw": {"color": "#ff0000", "handle": "iw", "mood": "offline"}, "pesterClient394": {"color": "#ff3737", "handle": "pesterClient394", "mood": "offline"}, "absoluteTranquility": {"color": "#000033", "handle": "absoluteTranquility", "mood": "offline"}, "centaursTesticle": {"color": "#000056", "handle": "centaursTesticle", "mood": "offline"}, "agogPorphyry": {"color": "#522d80", "handle": "agogPorphyry", "mood": "offline"}, "radicalApologist": {"color": "#ffaa00", "handle": "radicalApologist", "mood": "offline"}, "arachnidsGrip": {"color": "#005682", "handle": "arachnidsGrip", "mood": "offline"}, "illuminatedWax": {"color": "#ffff00", "handle": "illuminatedWax", "mood": "offline"}, "gamblingGenocider": {"color": "#00ff00", "handle": "gamblingGenocider", "mood": "offline"}, "elegantDiversion": {"color": "#12b40d", "handle": "elegantDiversion", "mood": "offline"}, "madLurker": {"color": "#000000", "handle": "madLurker", "mood": "offline"}, "testOut": {"color": "#c760cc", "handle": "testOut", "mood": "offline"}, "DocScratch": {"color": "#ffffff", "handle": "DocScratch", "mood": "offline"}, "recalcitrantDisaster": {"color": "#8b0068", "handle": "recalcitrantDisaster", "mood": "offline"}, "superGhost": {"color": "#800564", "handle": "superGhost", "mood": "offline"}, "tentacleTherapist": {"color": "#cc66ff", "handle": "tentacleTherapist", "mood": "offline"}, "aquaticMarinist": {"color": "#00caca", "handle": "aquaticMarinist", "mood": "offline"}, "captainCaveman": {"color": "#7c414e", "handle": "captainCaveman", "mood": "offline"}, "cuttlefishCuller": {"color": "#77003c", "handle": "cuttlefishCuller", "mood": "offline"}, "masterG": {"color": "#77003c", "handle": "masterG", "mood": "offline"}, "plasmaModerator": {"color": "#5685cc", "handle": "plasmaModerator", "mood": "offline"}, "remoteBloodbath": {"color": "#c70000", "handle": "remoteBloodbath", "mood": "offline"}, "rageInducer": {"color": "#00ffff", "handle": "rageInducer", "mood": "offline"}, "gallowsCalibrator": {"color": "#008282", "handle": "gallowsCalibrator", "mood": "offline"}, "greenZephyr": {"color": "#00ca40", "handle": "greenZephyr", "mood": "offline"}, "lawdEngrish": {"color": "#00ff00", "handle": "lawdEngrish", "mood": "offline"}, "adiosToreador": {"color": "#aa5500", "handle": "adiosToreador", "mood": "offline"}, "schlagzeugGator": {"color": "#61821f", "handle": "schlagzeugGator", "mood": "offline"}, "metaliAggressive": {"color": "#9289d5", "handle": "metaliAggressive", "mood": "offline"}, "magmaExploiter": {"color": "#d90000", "handle": "magmaExploiter", "mood": "offline"}, "gardenGnostic": {"color": "#00ff00", "handle": "gardenGnostic", "mood": "offline"}, "unknownTraveler": {"color": "#006666", "handle": "unknownTraveler", "mood": "offline"}, "utilitarianTurnabout": {"color": "#dd0000", "handle": "utilitarianTurnabout", "mood": "offline"}, "marineAquist": {"color": "#00caca", "handle": "marineAquist", "mood": "offline"}} {"macruralAlchemist": {"color": "#700000", "handle": "macruralAlchemist", "mood": "offline"}, "lyricalKeraunoscopic": {"color": "#00c000", "handle": "lyricalKeraunoscopic", "mood": "offline"}, "fireSwallow": {"color": "#80bb9a", "handle": "fireSwallow", "mood": "offline"}, "aquaMarinist": {"color": "#00caca", "handle": "aquaMarinist", "mood": "offline"}, "nitroZealist": {"color": "#ff3737", "handle": "nitroZealist", "mood": "offline"}, "mechanicalSpectacle": {"color": "#000000", "handle": "mechanicalSpectacle", "mood": "offline"}, "greyscalePacifist": {"color": "#7f7f7f", "handle": "greyscalePacifist", "mood": "offline"}, "caffeinatedAnalyst": {"color": "#aa0000", "handle": "caffeinatedAnalyst", "mood": "offline"}, "iw": {"color": "#ff0000", "handle": "iw", "mood": "offline"}, "insipidTranscient": {"color": "#104e68", "handle": "insipidTranscient", "mood": "offline"}, "pesterClient394": {"color": "#ff3737", "handle": "pesterClient394", "mood": "offline"}, "absoluteTranquility": {"color": "#000033", "handle": "absoluteTranquility", "mood": "offline"}, "centaursTesticle": {"color": "#000056", "handle": "centaursTesticle", "mood": "offline"}, "agogPorphyry": {"color": "#522d80", "handle": "agogPorphyry", "mood": "offline"}, "DocScratch": {"color": "#ffffff", "handle": "DocScratch", "mood": "offline"}, "apocalypseArisen": {"color": "#a10000", "handle": "apocalypseArisen", "mood": "offline"}, "radicalApologist": {"color": "#ffaa00", "handle": "radicalApologist", "mood": "offline"}, "microMachines": {"color": "#aa00ff", "handle": "microMachines", "mood": "offline"}, "arachnidsGrip": {"color": "#005682", "handle": "arachnidsGrip", "mood": "offline"}, "illuminatedWax": {"color": "#ffff00", "handle": "illuminatedWax", "mood": "offline"}, "tentacleTherapist": {"color": "#cc66ff", "handle": "tentacleTherapist", "mood": "offline"}, "gamblingGenocider": {"color": "#00ff00", "handle": "gamblingGenocider", "mood": "offline"}, "elegantDiversion": {"color": "#14b40a", "handle": "elegantDiversion", "mood": "offline"}, "madLurker": {"color": "#000000", "handle": "madLurker", "mood": "offline"}, "testOut": {"color": "#c760cc", "handle": "testOut", "mood": "offline"}, "androidTechnician": {"color": "#0000ff", "handle": "androidTechnician", "mood": "offline"}, "recalcitrantDisaster": {"color": "#8b0068", "handle": "recalcitrantDisaster", "mood": "offline"}, "superGhost": {"color": "#800564", "handle": "superGhost", "mood": "offline"}, "arsenicCatnip": {"color": "#006400", "handle": "arsenicCatnip", "mood": "offline"}, "aquaticMarinist": {"color": "#00caca", "handle": "aquaticMarinist", "mood": "offline"}, "captainCaveman": {"color": "#7c414e", "handle": "captainCaveman", "mood": "offline"}, "cuttlefishCuller": {"color": "#77003c", "handle": "cuttlefishCuller", "mood": "offline"}, "carcinoGeneticist": {"color": "#999999", "handle": "carcinoGeneticist", "mood": "offline"}, "masterG": {"color": "#77003c", "handle": "masterG", "mood": "offline"}, "plasmaModerator": {"color": "#5685cc", "handle": "plasmaModerator", "mood": "offline"}, "carcinoGenetecist": {"color": "#7f7f7f", "handle": "carcinoGenetecist", "mood": "offline"}, "remoteBloodbath": {"color": "#c70000", "handle": "remoteBloodbath", "mood": "offline"}, "moirailBunp": {"color": "#6a3d0f", "handle": "moirailBunp", "mood": "offline"}, "rageInducer": {"color": "#00ffff", "handle": "rageInducer", "mood": "offline"}, "gallowsCalibrator": {"color": "#008282", "handle": "gallowsCalibrator", "mood": "offline"}, "greenZephyr": {"color": "#00ca40", "handle": "greenZephyr", "mood": "offline"}, "lawdEngrish": {"color": "#00ff00", "handle": "lawdEngrish", "mood": "offline"}, "adiosToreador": {"color": "#aa5500", "handle": "adiosToreador", "mood": "offline"}, "maxiumumFatness": {"color": "#3366ff", "handle": "maxiumumFatness", "mood": "offline"}, "schlagzeugGator": {"color": "#61821f", "handle": "schlagzeugGator", "mood": "offline"}, "metaliAggressive": {"color": "#9289d5", "handle": "metaliAggressive", "mood": "offline"}, "midnightSparrow": {"color": "#ff55ff", "handle": "midnightSparrow", "mood": "offline"}, "magmaExploiter": {"color": "#d90000", "handle": "magmaExploiter", "mood": "offline"}, "zealousScarecrow": {"color": "#00c882", "handle": "zealousScarecrow", "mood": "offline"}, "gardenGnostic": {"color": "#00ff00", "handle": "gardenGnostic", "mood": "offline"}, "unknownTraveler": {"color": "#006666", "handle": "unknownTraveler", "mood": "offline"}, "utilitarianTurnabout": {"color": "#dd0000", "handle": "utilitarianTurnabout", "mood": "offline"}, "marineAquist": {"color": "#00caca", "handle": "marineAquist", "mood": "offline"}}

View file

@ -76,10 +76,12 @@ class TimeGrammar(object):
class TimeTracker(list): class TimeTracker(list):
def __init__(self, time=None): def __init__(self, time=None):
self.timerecord = {"P": [], "F": []} self.timerecord = {"P": [], "F": []}
self.open = {}
if time is not None: if time is not None:
self.append(time) self.append(time)
self.current=0 self.current=0
self.addRecord(time) self.addRecord(time)
self.open[time] = False
else: else:
self.current=-1 self.current=-1
def addTime(self, timed): def addTime(self, timed):
@ -90,6 +92,7 @@ class TimeTracker(list):
except ValueError: except ValueError:
self.current = len(self) self.current = len(self)
self.append(timed) self.append(timed)
self.open[timed] = False
self.addRecord(timed) self.addRecord(timed)
return False return False
def prevTime(self): def prevTime(self):
@ -121,9 +124,19 @@ class TimeTracker(list):
try: try:
self.pop(self.index(timed)) self.pop(self.index(timed))
self.current = len(self)-1 self.current = len(self)-1
del self.open[timed]
return True return True
except ValueError: except ValueError:
return None return None
def openTime(self, time):
if self.open.has_key(time):
self.open[time] = True
def openCurrentTime(self):
timed = self.getTime()
self.openTime(timed)
def isFirstTime(self):
timed = self.getTime()
return not self.open[timed]
def getTime(self): def getTime(self):
if self.current >= 0: if self.current >= 0:
return self[self.current] return self[self.current]
@ -235,22 +248,25 @@ class MemoText(PesterText):
newtime = timedelta(0) newtime = timedelta(0)
time = TimeTracker(newtime) time = TimeTracker(newtime)
parent.times[chum.handle] = time parent.times[chum.handle] = time
timeGrammar = time.getGrammar()
msg = chum.memojoinmsg(systemColor, time.getTime(), timeGrammar, window.theme["convo/text/joinmemo"])
self.append(convertTags(msg))
window.chatlog.log(parent.channel, convertTags(msg, "bbcode"))
else: else:
time = parent.time time = parent.time
if time.isFirstTime():
grammar = time.getGrammar()
joinmsg = chum.memojoinmsg(systemColor, time.getTime(), grammar, window.theme["convo/text/joinmemo"])
self.append(convertTags(joinmsg))
parent.mainwindow.chatlog.log(parent.channel, convertTags(msg, "bbcode"))
time.openCurrentTime()
if msg[0:3] == "/me" or msg[0:13] == "PESTERCHUM:ME": if msg[0:3] == "/me" or msg[0:13] == "PESTERCHUM:ME":
if msg[0:3] == "/me": if msg[0:3] == "/me":
start = 3 start = 3
else: else:
start = 13 start = 13
space = msg.find(" ") space = msg.find(" ")
msg = chum.memsg(systemColor, msg[start:space], msg[space:], time=time.getGrammar()) memsg = chum.memsg(systemColor, msg[start:space], msg[space:], time=time.getGrammar())
window.chatlog.log(parent.channel, convertTags(msg, "bbcode")) window.chatlog.log(parent.channel, convertTags(msg, "bbcode"))
self.append(convertTags(msg)) self.append(convertTags(memsg))
else: else:
if chum is not me: if chum is not me:
msg = addTimeInitial(msg, parent.times[chum.handle].getGrammar()) msg = addTimeInitial(msg, parent.times[chum.handle].getGrammar())
@ -359,6 +375,7 @@ class PesterMemo(PesterConvo):
timeGrammar = self.time.getGrammar() timeGrammar = self.time.getGrammar()
systemColor = QtGui.QColor(self.mainwindow.theme["memos/systemMsgColor"]) systemColor = QtGui.QColor(self.mainwindow.theme["memos/systemMsgColor"])
msg = p.memoopenmsg(systemColor, self.time.getTime(), timeGrammar, self.mainwindow.theme["convo/text/openmemo"], self.channel) msg = p.memoopenmsg(systemColor, self.time.getTime(), timeGrammar, self.mainwindow.theme["convo/text/openmemo"], self.channel)
self.time.openCurrentTime()
self.textArea.append(convertTags(msg)) self.textArea.append(convertTags(msg))
self.mainwindow.chatlog.log(self.channel, convertTags(msg, "bbcode")) self.mainwindow.chatlog.log(self.channel, convertTags(msg, "bbcode"))
@ -455,8 +472,6 @@ class PesterMemo(PesterConvo):
color = chumdb.getColor(handle, defaultcolor) color = chumdb.getColor(handle, defaultcolor)
item.setTextColor(color) item.setTextColor(color)
self.userlist.addItem(item) self.userlist.addItem(item)
self.userlist
def timeUpdate(self, handle, cmd): def timeUpdate(self, handle, cmd):
window = self.mainwindow window = self.mainwindow
@ -491,19 +506,11 @@ class PesterMemo(PesterConvo):
self.mainwindow.chatlog.log(self.channel, convertTags(msg, "bbcode")) self.mainwindow.chatlog.log(self.channel, convertTags(msg, "bbcode"))
elif timed not in self.times[handle]: elif timed not in self.times[handle]:
self.times[handle].addTime(timed) self.times[handle].addTime(timed)
grammar = self.times[handle].getGrammar()
msg = chum.memojoinmsg(systemColor, timed, grammar, window.theme["convo/text/joinmemo"])
self.textArea.append(convertTags(msg))
self.mainwindow.chatlog.log(self.channel, convertTags(msg, "bbcode"))
else: else:
self.times[handle].setCurrent(timed) self.times[handle].setCurrent(timed)
else: else:
if timed is not None: if timed is not None:
ttracker = TimeTracker(timed) ttracker = TimeTracker(timed)
grammar = ttracker.getGrammar()
msg = chum.memojoinmsg(systemColor, timed, grammar, window.theme["convo/text/joinmemo"])
self.textArea.append(convertTags(msg))
self.mainwindow.chatlog.log(self.channel, convertTags(msg, "bbcode"))
self.times[handle] = ttracker self.times[handle] = ttracker
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
@ -511,6 +518,8 @@ class PesterMemo(PesterConvo):
text = self.textInput.text() text = self.textInput.text()
if text == "": if text == "":
return return
if self.time.getTime() == None:
self.sendtime()
grammar = self.time.getGrammar() grammar = self.time.getGrammar()
# deal with quirks here # deal with quirks here
qtext = self.mainwindow.userprofile.quirks.apply(unicode(text)) qtext = self.mainwindow.userprofile.quirks.apply(unicode(text))
@ -573,7 +582,6 @@ class PesterMemo(PesterConvo):
if update == "nick": if update == "nick":
self.addUser(newnick) self.addUser(newnick)
elif update == "kick": elif update == "kick":
print "KICKING"
if len(chums) == 0: if len(chums) == 0:
return return
c = chums[0] c = chums[0]
@ -613,6 +621,7 @@ class PesterMemo(PesterConvo):
self.resetSlider(curtime) self.resetSlider(curtime)
self.mainwindow.joinChannel.emit(self.channel) self.mainwindow.joinChannel.emit(self.channel)
me = self.mainwindow.profile() me = self.mainwindow.profile()
self.time.openCurrentTime()
msg = me.memoopenmsg(systemColor, self.time.getTime(), self.time.getGrammar(), self.mainwindow.theme["convo/text/openmemo"], self.channel) msg = me.memoopenmsg(systemColor, self.time.getTime(), self.time.getGrammar(), self.mainwindow.theme["convo/text/openmemo"], self.channel)
self.textArea.append(convertTags(msg)) self.textArea.append(convertTags(msg))
self.mainwindow.chatlog.log(self.channel, convertTags(msg, "bbcode")) self.mainwindow.chatlog.log(self.channel, convertTags(msg, "bbcode"))
@ -643,9 +652,10 @@ class PesterMemo(PesterConvo):
return return
currentHandle = unicode(self.userlist.currentItem().text()) currentHandle = unicode(self.userlist.currentItem().text())
self.mainwindow.kickUser.emit(currentHandle, self.channel) self.mainwindow.kickUser.emit(currentHandle, self.channel)
def resetSlider(self, time): def resetSlider(self, time, send=True):
self.timeinput.setText(delta2txt(time)) self.timeinput.setText(delta2txt(time))
self.timeinput.setSlider() self.timeinput.setSlider()
if send:
self.sendtime() self.sendtime()
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
@ -654,10 +664,6 @@ class PesterMemo(PesterConvo):
systemColor = QtGui.QColor(self.mainwindow.theme["memos/systemMsgColor"]) systemColor = QtGui.QColor(self.mainwindow.theme["memos/systemMsgColor"])
time = txt2delta(self.timeinput.text()) time = txt2delta(self.timeinput.text())
present = self.time.addTime(time) present = self.time.addTime(time)
if not present:
msg = me.memojoinmsg(systemColor, time, self.time.getGrammar(), self.mainwindow.theme["convo/text/joinmemo"])
self.textArea.append(convertTags(msg))
self.mainwindow.chatlog.log(self.channel, convertTags(msg, "bbcode"))
serverText = "PESTERCHUM:TIME>"+delta2txt(time, "server") serverText = "PESTERCHUM:TIME>"+delta2txt(time, "server")
self.messageSent.emit(serverText, self.title()) self.messageSent.emit(serverText, self.title())
@ -676,6 +682,8 @@ class PesterMemo(PesterConvo):
newtime = self.time.getTime() newtime = self.time.getTime()
if newtime is None: if newtime is None:
newtime = timedelta(0) newtime = timedelta(0)
self.resetSlider(newtime, send=False)
else:
self.resetSlider(newtime) self.resetSlider(newtime)
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def prevtime(self): def prevtime(self):

BIN
memos.pyc

Binary file not shown.

View file

@ -42,9 +42,7 @@ def convertTags(string, format="html"):
return matchobj.group(1) return matchobj.group(1)
string = _urlre.sub(urlrep, string) string = _urlre.sub(urlrep, string)
if format == "html": if format == "html":
print string
string = _memore.sub(r" <a href='\1'>\1</a>", string) string = _memore.sub(r" <a href='\1'>\1</a>", string)
print string
return string return string
def escapeBrackets(string): def escapeBrackets(string):

Binary file not shown.

View file

@ -1 +1 @@
{"tabs": false, "chums": ["marineAquist", "unknownTraveler", "tentacleTherapist", "macruralAlchemist", "vaginalEngineer", "mechanicalSpectacle", "carcinoGeneticist", "schlagzeugGator", "gamblingGenocider", "gardenGnostic", "superGhost", "centaursTesticle", "arachnidsGrip", "grimAuxiliatrix", "remoteBloodbath", "nitroZealist", "greenZephyr", "arsenicCatnip", "adiosToreador", "cuttlefishCuller", "rageInducer", "gallowsCalibrator", "caligulasAquarium", "terminallyCapricious", "illuminatedWax", "testOut", "aquaMarinist"], "defaultprofile": "testProfile", "block": []} {"tabs": false, "chums": ["marineAquist", "unknownTraveler", "tentacleTherapist", "macruralAlchemist", "vaginalEngineer", "mechanicalSpectacle", "carcinoGeneticist", "schlagzeugGator", "gamblingGenocider", "gardenGnostic", "superGhost", "centaursTesticle", "arachnidsGrip", "grimAuxiliatrix", "remoteBloodbath", "nitroZealist", "greenZephyr", "arsenicCatnip", "adiosToreador", "cuttlefishCuller", "rageInducer", "gallowsCalibrator", "caligulasAquarium", "terminallyCapricious", "illuminatedWax", "aquaMarinist", "maxiumumFatness", "elegantDiversion", "moirailBunp", "uroborosUnbound", "androidTechnician", "midnightSparrow", "apocalypseArisen"], "defaultprofile": "testProfile", "block": []}

View file

@ -1495,6 +1495,8 @@ class IRCThread(QtCore.QThread):
irc = self.irc irc = self.irc
irc.IRCConnect() irc.IRCConnect()
while 1: while 1:
if irc.brokenConnection:
self.exit(1)
try: try:
irc.updateIRC() irc.updateIRC()
except socket.error: except socket.error:

View file

@ -1 +1 @@
{"color": "#ff00ff", "theme": "pesterchum7", "quirks": [], "handle": "ghostDunk"} {"color": "#ff00ff", "theme": "pesterchum", "quirks": [], "handle": "ghostDunk"}

View file

@ -1 +1 @@
{"color": "#aa00ff", "theme": "trollian", "quirks": [], "handle": "testProfile"} {"color": "#aa00ff", "theme": "pesterchum", "quirks": [], "handle": "testProfile"}

View file

@ -190,6 +190,7 @@
}, },
"convo": "convo":
{"style": "background-color: #fdb302; background-image:url($path/convobg.png); background-repeat: no-repeat; border:2px solid yellow; font-family: 'Courier'", {"style": "background-color: #fdb302; background-image:url($path/convobg.png); background-repeat: no-repeat; border:2px solid yellow; font-family: 'Courier'",
"tabstyle": "background-color: #fdb302; font-family: 'Courier'",
"scrollbar": { "style" : "", "handle": "" }, "scrollbar": { "style" : "", "handle": "" },
"margins": {"top": 0, "bottom": 6, "left": 0, "right": 0 }, "margins": {"top": 0, "bottom": 6, "left": 0, "right": 0 },
"size": [520, 325], "size": [520, 325],

View file

@ -236,6 +236,7 @@
}, },
"convo": "convo":
{"style": "background: rgb(190, 19, 4); font-family: 'Arial';", {"style": "background: rgb(190, 19, 4); font-family: 'Arial';",
"tabstyle": "background: rgb(190, 19, 4); font-family: 'Arial'",
"scrollbar": { "style" : "", "handle": "" }, "scrollbar": { "style" : "", "handle": "" },
"margins": {"top": 22, "bottom": 9, "left": 10, "right": 4 }, "margins": {"top": 22, "bottom": 9, "left": 10, "right": 4 },
"size": [400, 250], "size": [400, 250],