MUSH log parser
(This is old Python stuff. You should probably just move along, but I’m still stupidly proud of that parser and its output.)
>>> from LogTree import *
>>> from TagRules import *
>>> tr = TagRules({'backlog': TagRules.F_ENCLOSING})
>>> lt = LogTree(file("../test/TestMUSH_20120810_1943.log", "r"), tr)
>>> lt.root.display()
"""
<ROOT>
┣╸LogTag(u'logging started on 2012-08-10 at 19', u'43.')
┣╸LogLine(u'--------------------------------[... 47 more characters]')
┣╸LogLine(u'\n')
┣╸LogLine(u' TestMUSH\n')
┣╸LogLine(u'\n')
┣╸LogLine(u' Welcome to TestMUSH. This is[... 32 more characters]')
┣╸LogLine(u'\n')
┣╸LogLine(u' None of this is real.\n')
┣╸LogLine(u'\n')
┣╸LogLine(u' Enjoy!\n')
┣╸LogLine(u'\n')
┣╸LogLine(u'--------------------------------[... 47 more characters]')
┣╸LogLine(u'The Lounge(#1234R)\n')
┣╸LogLine(u"It's a lounge, you know, with lo[... 90 more characters]")
┣╸LogLine(u'Contents:\n')
┣╸LogLine(u'Player(#6789Oaepqs)\n')
┣╸LogLine(u'Obvious exits:\n')
┣╸LogLine(u'Bedroom Outside\n')
┣╸LogLine(u'Player says, "Woah, I can\'t beli[... 38 more characters]')
┣╸LogLine(u'Player snorts derisively at the [... 17 more characters]')
┣╸LogLine(u'From afar, Guest waves hello.\n')
┣╸LogLine(u'Guest pages: hey there, care for[... 33 more characters]')
┣╸LogLine(u'You page Guest with: Sure, why n[... 4 more characters]')
┣╸LogTag(u'scene', u'continued')
┣╸LogTag(u'title', u"Ceci n'est pas un Lorem Ipsum")
┣╸LogLine(u'Guest comes through the front do[... 4 more characters]')
┣╸LogLine(u'Guest has arrived.\n')
┣╸LogLine(u'OOC> Guest says, "Do you have th[... 37 more characters]')
┣╸LogTag(u'characters', u'Player Guest')
┣╸LogLine(u'OOC> Player smirks. "Dude, way a[... 14 more characters]')
┣╸LogTag(u'backlog', <...>)
┃ ┣╸LogLine(u' Amet montes ut! Pulvinar pul[... 777 more characters]')
┃ ┣╸LogLine(u'\n')
┃ ┗╸LogLine(u' In magna nec, pid auctor! Tr[... 777 more characters]')
┣╸LogLine(u'OOC> Guest says, "Dude, that\'s s[... 43 more characters]')
┣╸LogLine(u' Nisi cum! Duis rhoncus integ[... 294 more characters]')
┣╸LogLine(u' Nisi placerat nascetur. Habi[... 326 more characters]')
┣╸LogLine(u'\n')
┣╸LogLine(u' Egestas. Aliquam scelerisque[... 328 more characters]')
┣╸LogLine(u'OOC> Player swears. "Gotta go no[... 33 more characters]')
┣╸LogLine(u'OOC> Guest says, "No sweat, I\'ll[... 64 more characters]')
┣╸LogLine(u'*** Disconnected from TestMUSH *[... 3 more characters]')
┗╸LogTag(u'connection to testmush closed by foreign host.')
"""
Yeah, I’m still trying to automate RP transcript cleanup, sorting and tagging (or, occasionally, deleting.) If only in the vague hope that I may someday have a nice, edited collection of my old PernMUSH logs.
You know, for old times’ sake!