bug fixes

This commit is contained in:
illuminatedwax 2011-04-10 04:22:06 -05:00
parent ea14290ea4
commit a02790f9b1
7 changed files with 67 additions and 21 deletions

View file

@ -12,11 +12,17 @@ CHANGELOG
* Art - Grimlive [aquaMarinist] * Art - Grimlive [aquaMarinist]
* Quirks lower() function - Kiooeht [evacipatedBox] * Quirks lower() function - Kiooeht [evacipatedBox]
* Quirks scrabble() function - Kiooeht [evacipatedBox] * Quirks scrabble() function - Kiooeht [evacipatedBox]
* Quirks reverse() function - illuminatedwax [ghostDunk]
* Timestamps - Kiooeht [evacipatedBox] * Timestamps - Kiooeht [evacipatedBox]
* Logviewer - Kiooeht [evacipatedBox] * Logviewer - Kiooeht [evacipatedBox]
* Quirk ordering - alGore * Quirk ordering - alGore
* # of users in a memo * # of users in a memo - alGore
BUG FIXES: BUG FIXES:
* mixer bug fixed
* "flags" bug fixed
* incorrect characters in memos no longer break log file names * incorrect characters in memos no longer break log file names
* memos now do not break on case-sensitivity * memos now do not break on case-sensitivity
* fixed QDB address
* now lines too long to send in a single message are split up correctly
* quirk replace bug fixed

5
TODO
View file

@ -1,8 +1,5 @@
Bugs: Bugs:
* multiline msgs breaks shit * weird memo time bug
* REGEXP: \b(\S)(\S*)(\S)\b REPLACE WITH: upper(\1)\2upper(\3) <--
this regexp, when used as a quirk and then typed in breaks
* channels aren't case sensitive! get the real name of a channel
* Windows doesn't show style sheet sometimes?? Maybe related to themes. * Windows doesn't show style sheet sometimes?? Maybe related to themes.
* Issues with connecting? Client not closing connection right? People keep getting "nick taken" messages * Issues with connecting? Client not closing connection right? People keep getting "nick taken" messages
* Windows XP SP2: sometimes mouse clicks dont register? must be some kinda crash * Windows XP SP2: sometimes mouse clicks dont register? must be some kinda crash

View file

@ -9,7 +9,7 @@ from PyQt4 import QtGui, QtCore
from dataobjs import PesterProfile, Mood, PesterHistory from dataobjs import PesterProfile, Mood, PesterHistory
from generic import PesterIcon, RightClickList from generic import PesterIcon, RightClickList
from parsetools import convertTags, lexMessage, mecmd, colorBegin, colorEnd, img2smiley from parsetools import convertTags, lexMessage, splitMessage, mecmd, colorBegin, colorEnd, img2smiley
class PesterTabWindow(QtGui.QFrame): class PesterTabWindow(QtGui.QFrame):
def __init__(self, mainwindow, parent=None, convo="convo"): def __init__(self, mainwindow, parent=None, convo="convo"):
@ -350,7 +350,7 @@ class PesterText(QtGui.QTextEdit):
"Accept": "text/plain"} "Accept": "text/plain"}
try: try:
pass pass
hconn = httplib.HTTPConnection('luke.violentlemon.com', 80, hconn = httplib.HTTPConnection('qdb.pesterchum.net', 80,
timeout=15) timeout=15)
hconn.request("POST", "/index.php", params, headers) hconn.request("POST", "/index.php", params, headers)
response = hconn.getresponse() response = hconn.getresponse()
@ -599,13 +599,17 @@ class PesterConvo(QtGui.QFrame):
lexmsg = lexMessage(text) lexmsg = lexMessage(text)
if type(lexmsg[0]) is not mecmd and self.applyquirks: if type(lexmsg[0]) is not mecmd and self.applyquirks:
lexmsg = quirks.apply(lexmsg) lexmsg = quirks.apply(lexmsg)
serverMsg = copy(lexmsg) lexmsgs = splitMessage(lexmsg)
self.addMessage(lexmsg, True)
# if ceased, rebegin for lm in lexmsgs:
if hasattr(self, 'chumopen') and not self.chumopen: serverMsg = copy(lm)
self.mainwindow.newConvoStarted.emit(QtCore.QString(self.title()), True) self.addMessage(lm, True)
text = convertTags(serverMsg, "ctag") # if ceased, rebegin
self.messageSent.emit(text, self.title()) if hasattr(self, 'chumopen') and not self.chumopen:
self.mainwindow.newConvoStarted.emit(QtCore.QString(self.title()), True)
self.setChumOpen(True)
text = convertTags(serverMsg, "ctag")
self.messageSent.emit(text, self.title())
self.textInput.setText("") self.textInput.setText("")
@QtCore.pyqtSlot() @QtCore.pyqtSlot()

View file

@ -7,10 +7,11 @@ from generic import PesterIcon
from parsetools import timeDifference, convertTags, lexMessage from parsetools import timeDifference, convertTags, lexMessage
from mispeller import mispeller from mispeller import mispeller
_upperre = re.compile(r"upper\(([\w\\]+)\)") _groupre = re.compile(r"\\([0-9]+)")
_lowerre = re.compile(r"lower\(([\w\\]+)\)") _upperre = re.compile(r"upper\(([\w<>\\]+)\)")
_scramblere = re.compile(r"scramble\(([\w\\]+)\)") _lowerre = re.compile(r"lower\(([\w<>\\]+)\)")
_reversere = re.compile(r"reverse\(([\w\\]+)\)") _scramblere = re.compile(r"scramble\(([\w<>\\]+)\)")
_reversere = re.compile(r"reverse\(([\w<>\\]+)\)")
class Mood(object): class Mood(object):
moods = ["chummy", "rancorous", "offline", "pleasant", "distraught", moods = ["chummy", "rancorous", "offline", "pleasant", "distraught",
@ -63,6 +64,7 @@ class pesterQuirk(object):
return string return string
def regexprep(mo): def regexprep(mo):
to = self.quirk["to"] to = self.quirk["to"]
to = _groupre.sub(r"\\g<\1>", to)
def upperrep(m): def upperrep(m):
return mo.expand(m.group(1)).upper() return mo.expand(m.group(1)).upper()
def lowerrep(m): def lowerrep(m):

4
irc.py
View file

@ -97,8 +97,8 @@ class PesterIRC(QtCore.QThread):
space = l[0].rfind(" ", 0,400) space = l[0].rfind(" ", 0,400)
if space == -1: if space == -1:
space = 400 space = 400
a = l[0][0:space] a = l[0][0:space+1]
b = l[0][space:] b = l[0][space+1:]
if len(b) > 0: if len(b) > 0:
return [a] + splittext([b]) return [a] + splittext([b])
else: else:

View file

@ -131,6 +131,8 @@ def lexMessage(string):
(hyperlink, _urlre), (memolex, _memore), (hyperlink, _urlre), (memolex, _memore),
(smiley, _smilere)] (smiley, _smilere)]
string = unicode(string)
string = string.replace("\n", " ").replace("\r", " ")
lexed = lexer(unicode(string), lexlist) lexed = lexer(unicode(string), lexlist)
balanced = [] balanced = []
@ -176,6 +178,41 @@ def convertTags(lexed, format="html"):
return escaped return escaped
def splitMessage(msg, format="ctag"):
"""Splits message if it is too long."""
okmsg = []
cbegintags = []
output = []
for o in msg:
okmsg.append(o)
if type(o) is colorBegin:
cbegintags.append(o)
elif type(o) is colorEnd:
cbegintags.pop()
# yeah normally i'd do binary search but im lazy
msglen = len(convertTags(okmsg, format)) + 4*(len(cbegintags))
if msglen > 400:
okmsg.pop()
if len(okmsg) == 0:
output.append([o])
else:
tmp = []
for color in cbegintags:
okmsg.append(colorEnd("</c>"))
tmp.append(color)
output.append(okmsg)
if type(o) is colorBegin:
cbegintags.append(o)
elif type(o) is colorEnd:
cbegintags.pop()
tmp.append(o)
okmsg = tmp
if len(okmsg) > 0:
output.append(okmsg)
return output
def addTimeInitial(string, grammar): def addTimeInitial(string, grammar):
endofi = string.find(":") endofi = string.find(":")

View file

@ -1 +1 @@
{"hideOfflineChums": true, "time12Format": true, "tabs": true, "showSeconds": false, "server": "irc.mindfang.org", "soundon": true, "showTimeStamps": false, "chums": ["unknownTraveler", "tentacleTherapist", "vaginalEngineer", "mechanicalSpectacle", "carcinoGeneticist", "schlagzeugGator", "gamblingGenocider", "gardenGnostic", "centaursTesticle", "arachnidsGrip", "grimAuxiliatrix", "remoteBloodbath", "nitroZealist", "greenZephyr", "arsenicCatnip", "cuttlefishCuller", "rageInducer", "gallowsCalibrator", "caligulasAquarium", "terminallyCapricious", "illuminatedWax", "aquaMarinist", "elegantDiversion", "moirailBunp", "uroborosUnbound", "androidTechnician", "midnightSparrow", "apocalypseArisen", "anguillaNuntia", "oilslickOrchid", "pretentiousFantasia", "aquaticMarinist", "lyricalKeraunoscopic", "counterRealist", "ectoBiologist", "percipientPedestrian", "asceticClinician", "doctectiveMiracles", "noSense", "ircMonster", "twinArmageddons", "cannabisHero", "jetRocket", "adiosToreador", "turntechGodhead", "magmaExploiter", "hannaSongstress", "endlessVoid", "grayscaleVisionary", "corruptedInsanity", "stupidlyBrilliant", "artsyGyarados", "obliviousCrafter", "sporadicAgent", "subtleChaotician", "nareSolee", "apostateCourier", "nocturnalTherapist", "herpaDerp", "clockworkUtopia", "digitalSamurai", "astronomicalMaster", "slipshodBrisant", "genialDustbuster", "hyperdriveTyphoon", "magnificentMiser", "gentleRuffian", "riskRepeats", "globalsoftPrika", "globalsoftPirka", "devonianCritter", "lethargicSerpent", "laughingShisa", "bluntInstrument", "sunilaSeed", "bluntInstrument", "nickServ", "ghostBinoculars", "alGore", "evacipatedBox"], "defaultprofile": "ghostDunk", "block": []} {"hideOfflineChums": false, "time12Format": true, "tabs": true, "soundon": true, "server": "irc.mindfang.org", "showSeconds": false, "showTimeStamps": false, "chums": ["unknownTraveler", "tentacleTherapist", "vaginalEngineer", "mechanicalSpectacle", "carcinoGeneticist", "schlagzeugGator", "gamblingGenocider", "gardenGnostic", "centaursTesticle", "arachnidsGrip", "grimAuxiliatrix", "remoteBloodbath", "nitroZealist", "greenZephyr", "arsenicCatnip", "cuttlefishCuller", "rageInducer", "gallowsCalibrator", "caligulasAquarium", "terminallyCapricious", "illuminatedWax", "aquaMarinist", "elegantDiversion", "moirailBunp", "uroborosUnbound", "androidTechnician", "midnightSparrow", "apocalypseArisen", "anguillaNuntia", "oilslickOrchid", "pretentiousFantasia", "aquaticMarinist", "lyricalKeraunoscopic", "counterRealist", "ectoBiologist", "percipientPedestrian", "asceticClinician", "doctectiveMiracles", "noSense", "ircMonster", "twinArmageddons", "cannabisHero", "jetRocket", "adiosToreador", "turntechGodhead", "magmaExploiter", "hannaSongstress", "endlessVoid", "grayscaleVisionary", "corruptedInsanity", "stupidlyBrilliant", "artsyGyarados", "obliviousCrafter", "sporadicAgent", "subtleChaotician", "nareSolee", "apostateCourier", "nocturnalTherapist", "herpaDerp", "clockworkUtopia", "digitalSamurai", "astronomicalMaster", "slipshodBrisant", "genialDustbuster", "hyperdriveTyphoon", "magnificentMiser", "gentleRuffian", "riskRepeats", "globalsoftPrika", "globalsoftPirka", "devonianCritter", "lethargicSerpent", "laughingShisa", "bluntInstrument", "sunilaSeed", "bluntInstrument", "nickServ", "ghostBinoculars", "alGore", "evacipatedBox", "acrylicEmulator", "prettyGemmaiden"], "defaultprofile": "testProfile", "block": []}