Will's blog

purpose: Will Kahn-Greene's blog of Python, Linux, random content, PyBlosxom, Miro, and other projects mixed in there ad hoc, half-baked, and with a twist of lemon

Fri, 27 Dec 2002

regular expressions in highlights and telnet control handling

I fixed some issues with telnet control handling which were borked. I also adjusted some things so that we show up more favorably on the Cryosphere mud client support table after talking with the maintainer of that table. I may look into adding some more features based on that table--like NAWS support. The existing problem is that for the textui, I can't seem to determine what the LINES/COLS numbers should be if you're running Lyntin over telnet/ssh. I'm tossing around adding hooks for telnet control negotiation and changing the MudEcho handling to use this hook instead. That'd open up the possibility of creating something like a wxPython ui which is completely xterm compliant. I have to toss this around a bit more. I also want to enable logging of incoming telnet control code sequences so I can see what's going on.

I finally added Sebastians patch for regular expressions in highlights, though I made some adjustments to account for the current codebase (the patch was from like 6 months ago or so) and also to use our regular expression syntax instead of a toggle on the Session.

It's slick! The regular expression implementation is also faster than my original string.find implementation. Doing something like this:

  > #highlight red e
  lyntin: highlight: {red} {e} added.
  > #highlight green i
  lyntin: highlight: {green} {i} added.
  > #highlight blue a
  lyntin: highlight: {blue} {a} added.

doesn't tax Lyntin as much as it did with the string.find method. I kind of wish I had done this a few months ago, but didn't really get around to putting in the time to figure out what needed to be done. I think I'm going to overhaul substitutes/gags in the same way next.

Please keep comments appropriate. I reserve the right to remove anonymous comments, flames, spammy, inappropriate, and other comments that I deem to be worth removing.

Note: New comments get placed in a "draft" status and will NOT show up on the site until I explicitly approve it. Usually that happens within 24 hours, but sometimes I go away and it takes a day or two.

Note 2: There is now a preview button for those of you who want to see a preview! However, it doesn't quite work the way you'd think it should work. I'll look into adjusting it some day.

Note 3: If you can't for some reason post a comment, send me an email: willg at bluesock dot org.

Your name:


Your e-mail address (this doesn't get displayed to anyone--I use it to contact you if there are issues):


URL of your website (optional):


Comment:


Yes, I am a human!

pyblosxom::2.0 dev

All contents Copyright 1996 to 2008 Will Guaraldi.
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.