From 05faa26fc6d99ba0eaddde10dd2a8d6eca19b62f Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Mon, 8 Feb 2010 20:21:35 -0600 Subject: prettified the theme and output --- conf/example.conf | 2 +- conf/stylesheet.css | 18 +++++++++--------- logbot.py | 26 +++++++++++++------------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/conf/example.conf b/conf/example.conf index 9f0f625..c5a1cdc 100644 --- a/conf/example.conf +++ b/conf/example.conf @@ -7,4 +7,4 @@ owners = excid3 [log] folder = logs -stylesheet = conf/stylesheet.css \ No newline at end of file +stylesheet = file:///C:\Users\Chris Oliver\Desktop\logbot\conf\stylesheet.css \ No newline at end of file diff --git a/conf/stylesheet.css b/conf/stylesheet.css index 8b5ace1..6842b73 100644 --- a/conf/stylesheet.css +++ b/conf/stylesheet.css @@ -1,18 +1,18 @@ body { background-color: #F8F8FF; - font-family: arial, sans-serif; + font-family: Fixed, monospace; font-size: 13px; } .time { - color: #445588; + color: #525552; + text-decoration: none; } -.person { - color: #DD1144; - font-weight: bold; -} +.time:hover { text-decoration: underline; } + +.person { color: #DD1144; } + +.join, .part, .quit, .kick, .mode { color: #42558C; } -.kick { - color: #FF0000; -} \ No newline at end of file +.notice { color: #AE768C; } \ No newline at end of file diff --git a/logbot.py b/logbot.py index b7076e0..1378ac1 100644 --- a/logbot.py +++ b/logbot.py @@ -63,7 +63,7 @@ class LogBot(object): self.owner = owner self.nick = nick self.folder = folder - self.stylesheet = "file:///" + os.path.abspath(stylesheet) + self.stylesheet = stylesheet def start(self): # Write logs locally, so we need the folder to exist @@ -109,8 +109,8 @@ class LogBot(object): # event.source(), event.target(), event.arguments() person, reason = event.arguments() self.write(event.target(), - "%s left the room (Kicked by %s (%s))" % \ - (person, event.source().split("!")[0], reason)) + "-!- %s was kicked from %s by %s [%s]" % \ + (person, event.target(), event.source().split("!")[0], reason)) def handleMode(self, connection, event): """Handles mode changes @@ -120,8 +120,8 @@ class LogBot(object): #print event.source(), event.target(), event.arguments() modes, person = event.arguments() self.write(event.target(), - "Mode %s set on %s by %s" % \ - (modes, person, event.source().split("!")[0])) + "-!- mode/%s [%s %s] by %s" % \ + (event.target(), modes, person, event.source().split("!")[0])) def handlePubNotice(self, connection, event): """Handles public notices @@ -130,8 +130,8 @@ class LogBot(object): # user, channel, [msg] #print event.source(), event.target(), event.arguments() self.write(event.target(), - "- %s: %s -" % \ - (event.source().split("!")[0], event.arguments()[0])) + "-%s:%s- %s" % \ + (event.source().split("!")[0], event.target(), event.arguments()[0])) def handleQuit(self, connection, event): """Handles quite messages @@ -140,7 +140,7 @@ class LogBot(object): # user, channel?, [reason] #print event.source(), event.target(), event.arguments() self.write(None, - "%s has quit (%s)" % \ + "-!- %s has quit [%s]" % \ (event.source().split("!")[0], event.arguments()[0])) def handlePrivMessage(self, connection, event): @@ -162,7 +162,7 @@ class LogBot(object): nick = nick[0] self.write(event.target(), - "%s (%s) has joined %s" % \ + "-!- %s (%s) has joined %s" % \ (nick, nickmask, event.target())) def handlePubMessage(self, connection, event): @@ -171,7 +171,7 @@ class LogBot(object): """ nick = event.source().split("!")[0] self.write(event.target(), - "%s: %s" % \ + "< %s > %s" % \ (nick, event.arguments()[0])) def handlePart(self, connection, event): @@ -180,7 +180,7 @@ class LogBot(object): """ nick = event.source().split("!")[0] self.write(event.target(), - "%s has parted %s" % \ + "-!- %s has parted %s" % \ (nick, event.target())) def handleInvite(self, connection, event): @@ -198,7 +198,7 @@ class LogBot(object): self.server.join(channel) def write(self, channel, message): - time = strftime("[%H:%M:%S]") + time = strftime("%H:%M:%S") date = strftime("%d-%m-%Y") if channel: print "%s> %s %s" % (channel, time, message) @@ -222,7 +222,7 @@ class LogBot(object): f.close() data = open(path, "rb").readlines()[:-2] - data.append("%s %s
\n" % (time, message)) + data.append("[%s] %s
\n" % (time, time, time, message)) data += [" \n", "\n"] f = open(path, "wb") -- cgit v1.2.3-70-g09d2