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]
* Quirks lower() function - Kiooeht [evacipatedBox]
* Quirks scrabble() function - Kiooeht [evacipatedBox]
* Quirks reverse() function - illuminatedwax [ghostDunk]
* Timestamps - Kiooeht [evacipatedBox]
* Logviewer - Kiooeht [evacipatedBox]
* Quirk ordering - alGore
* # of users in a memo
* # of users in a memo - alGore
BUG FIXES:
* mixer bug fixed
* "flags" bug fixed
* incorrect characters in memos no longer break log file names
* 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:
* multiline msgs breaks shit
* 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
* weird memo time bug
* 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
* 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 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):
def __init__(self, mainwindow, parent=None, convo="convo"):
@ -350,7 +350,7 @@ class PesterText(QtGui.QTextEdit):
"Accept": "text/plain"}
try:
pass
hconn = httplib.HTTPConnection('luke.violentlemon.com', 80,
hconn = httplib.HTTPConnection('qdb.pesterchum.net', 80,
timeout=15)
hconn.request("POST", "/index.php", params, headers)
response = hconn.getresponse()
@ -599,11 +599,15 @@ class PesterConvo(QtGui.QFrame):
lexmsg = lexMessage(text)
if type(lexmsg[0]) is not mecmd and self.applyquirks:
lexmsg = quirks.apply(lexmsg)
serverMsg = copy(lexmsg)
self.addMessage(lexmsg, True)
lexmsgs = splitMessage(lexmsg)
for lm in lexmsgs:
serverMsg = copy(lm)
self.addMessage(lm, True)
# if ceased, rebegin
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("")

View file

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

4
irc.py
View file

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

View file

@ -131,6 +131,8 @@ def lexMessage(string):
(hyperlink, _urlre), (memolex, _memore),
(smiley, _smilere)]
string = unicode(string)
string = string.replace("\n", " ").replace("\r", " ")
lexed = lexer(unicode(string), lexlist)
balanced = []
@ -176,6 +178,41 @@ def convertTags(lexed, format="html"):
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):
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": []}