Fixed an OOC bug, made OOC detection stricter while doing that.

This commit is contained in:
karxi 2016-11-19 13:39:56 -05:00
parent 876e06f217
commit eee0e3bd91
5 changed files with 15 additions and 11 deletions

View file

@ -32,10 +32,12 @@ Features
* Redo quirk processing (use pieces from Textsub if needed) * Redo quirk processing (use pieces from Textsub if needed)
* LET PEOPLE TURN OFF HONKING - people already rename the soundfile and such to do this manually * LET PEOPLE TURN OFF HONKING - people already rename the soundfile and such to do this manually
* Make CTRL+PGUP/PGDN switch memo/pester tabs * Make CTRL+PGUP/PGDN switch memo/pester tabs
* Redo OOC detection/make it less inconsistent (require matching braces) * Set up a simple function to display a traceback instead of silently moving on!
* SOONER OR LATER: Redo internal chum storage, centralize data into widely accessible manager objects, etc. * SOONER OR LATER: Redo internal chum storage, centralize data into widely accessible manager objects, etc.
* Also: Overhaul settings storage. Bring it more in line with the system Textsub used (if feeling masochistic), but simpler. * Also: Overhaul settings storage. Bring it more in line with the system Textsub used (if feeling masochistic), but simpler.
* Overhaul debugging
* Make a console to display debug info without requiring us to run from console
Bugs Bugs
---- ----
@ -52,6 +54,9 @@ Bugs
* Mentions occasionally don't work (e.g. in /me) * Mentions occasionally don't work (e.g. in /me)
* Character times aren't 'forgotten' on Part * Character times aren't 'forgotten' on Part
* +c is not properly recognized on join, nor does it stop someone from reenabling their quirk (let ops and above ignore it)
* Chumlist handles groups pretty badly (no using the same name as a handle, for example? Needs an errormessage at least)
* PESTERCHUM: messages are sent to things like NickServ
Windows Bugs Windows Bugs
------------ ------------

View file

@ -11,7 +11,7 @@ from mood import Mood
from dataobjs import PesterProfile, PesterHistory from dataobjs import PesterProfile, PesterHistory
from generic import PesterIcon from generic import PesterIcon
from parsetools import convertTags, lexMessage, splitMessage, mecmd, colorBegin, colorEnd, \ from parsetools import convertTags, lexMessage, splitMessage, mecmd, colorBegin, colorEnd, \
img2smiley, smiledict, oocre img2smiley, smiledict
import parsetools import parsetools
import pnc.lexercon as lexercon import pnc.lexercon as lexercon

View file

@ -9,7 +9,7 @@ from dataobjs import PesterProfile, PesterHistory
from generic import PesterIcon, RightClickList, mysteryTime from generic import PesterIcon, RightClickList, mysteryTime
from convo import PesterConvo, PesterInput, PesterText, PesterTabWindow from convo import PesterConvo, PesterInput, PesterText, PesterTabWindow
from parsetools import convertTags, addTimeInitial, timeProtocol, \ from parsetools import convertTags, addTimeInitial, timeProtocol, \
lexMessage, colorBegin, colorEnd, mecmd, smiledict, oocre lexMessage, colorBegin, colorEnd, mecmd, smiledict
import parsetools import parsetools
from logviewer import PesterLogViewer from logviewer import PesterLogViewer

View file

@ -7,8 +7,6 @@ from dataobjs import pesterQuirk, PesterProfile
from memos import TimeSlider, TimeInput from memos import TimeSlider, TimeInput
from version import _pcVersion from version import _pcVersion
import parsetools
_datadir = ostools.getDataDir() _datadir = ostools.getDataDir()
class PesterQuirkItem(QtGui.QTreeWidgetItem): class PesterQuirkItem(QtGui.QTreeWidgetItem):
@ -213,6 +211,7 @@ class PesterQuirkList(QtGui.QTreeWidget):
from copy import copy from copy import copy
from convo import PesterInput, PesterText from convo import PesterInput, PesterText
from parsetools import convertTags, lexMessage, splitMessage, mecmd, colorBegin, colorEnd, img2smiley, smiledict from parsetools import convertTags, lexMessage, splitMessage, mecmd, colorBegin, colorEnd, img2smiley, smiledict
import parsetools
from dataobjs import pesterQuirks, PesterHistory from dataobjs import pesterQuirks, PesterHistory
class QuirkTesterWindow(QtGui.QDialog): class QuirkTesterWindow(QtGui.QDialog):
def __init__(self, parent): def __init__(self, parent):

View file

@ -26,7 +26,7 @@ _memore = re.compile(r"(\s|^)(#[A-Za-z0-9_]+)")
_handlere = re.compile(r"(\s|^)(@[A-Za-z0-9_]+)") _handlere = re.compile(r"(\s|^)(@[A-Za-z0-9_]+)")
_imgre = re.compile(r"""(?i)<img src=['"](\S+)['"]\s*/>""") _imgre = re.compile(r"""(?i)<img src=['"](\S+)['"]\s*/>""")
_mecmdre = re.compile(r"^(/me|PESTERCHUM:ME)(\S*)") _mecmdre = re.compile(r"^(/me|PESTERCHUM:ME)(\S*)")
oocre = re.compile(r"[\[(][\[(].*[\])][\])]") _oocre = re.compile(r"([\[(])\1.*([\])])\2")
_format_begin = re.compile(r'(?i)<([ibu])>') _format_begin = re.compile(r'(?i)<([ibu])>')
_format_end = re.compile(r'(?i)</([ibu])>') _format_end = re.compile(r'(?i)</([ibu])>')
_honk = re.compile(r"(?i)\bhonk\b") _honk = re.compile(r"(?i)\bhonk\b")
@ -463,9 +463,9 @@ def kxsplitMsg(lexed, fmt="pchum", maxlen=None, debug=False):
# ... # ...
# ON SECOND THOUGHT: The lexer balances for us, so let's just use # ON SECOND THOUGHT: The lexer balances for us, so let's just use
# that for now. I can split up the function for this later. # that for now. I can split up the function for this later.
working = ''.join(kxpclexer.list_convert(working)) working = u''.join(kxpclexer.list_convert(working))
working = kxpclexer.lex(working) working = kxpclexer.lex(working)
working = ''.join(kxpclexer.list_convert(working)) working = u''.join(kxpclexer.list_convert(working))
# TODO: Is that lazy? Yes. This is a modification made to test if # TODO: Is that lazy? Yes. This is a modification made to test if
# it'll work, *not* if it'll be efficient. # it'll work, *not* if it'll be efficient.
@ -518,7 +518,7 @@ def kxsplitMsg(lexed, fmt="pchum", maxlen=None, debug=False):
else: else:
# Once we're finally out of things to add, we're, well...out. # Once we're finally out of things to add, we're, well...out.
# So add working to the result one last time. # So add working to the result one last time.
working = ''.join(kxpclexer.list_convert(working)) working = u''.join(kxpclexer.list_convert(working))
output.append(working) output.append(working)
# We're...done? # We're...done?
@ -631,7 +631,7 @@ def kxhandleInput(ctx, text=None, flavor=None):
if flavor != "menus": if flavor != "menus":
# Check if the line is OOC. Note that Pesterchum *is* kind enough to strip # Check if the line is OOC. Note that Pesterchum *is* kind enough to strip
# trailing spaces for us, even in the older versions. # trailing spaces for us, even in the older versions.
oocDetected = oocre.match(text.strip()) oocDetected = _oocre.match(text.strip())
is_ooc = ctx.ooc or oocDetected is_ooc = ctx.ooc or oocDetected
if ctx.ooc and not oocDetected: if ctx.ooc and not oocDetected:
# If we're supposed to be OOC, apply it artificially. # If we're supposed to be OOC, apply it artificially.
@ -752,7 +752,7 @@ def kxhandleInput(ctx, text=None, flavor=None):
serverMsg = copy(lm) serverMsg = copy(lm)
# Memo-specific processing. # Memo-specific processing.
if flavor == "memos" and not (is_action or is_ooc): if flavor == "memos" and not is_action:
# Quirks were already applied, so get the prefix/postfix stuff # Quirks were already applied, so get the prefix/postfix stuff
# ready. # ready.
# We fetched the information outside of the loop, so just # We fetched the information outside of the loop, so just