diff --git a/.gitignore b/.gitignore
index 8b14f43..07e03ce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
-.vagrant*
-config.json
-logs
-*.pyc
+.vagrant*
+config.json
+logs
+*.pyc
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..eb1da12
--- /dev/null
+++ b/README.md
@@ -0,0 +1,30 @@
+LogsToDB
+=========
+Version
+----
+0.0.1
+
+Tech
+-----------
+
+This is built as a plugin for Limnoria, to use it it's best you git pull this repository into the plugins directory of your bot.
+
+This plugin also relies on a postgres database running, you can set one up yourself by running the setup.py file
+
+Dependancies
+-----------
+
+* *postgresql* - The live VPS is running postgreSQL 9.1 so it would work out better to have a similar version running
+* *pip* - package manager for Python
+* *libpq-dev* - for psycopg2
+* *python-dev* - for psycopg2
+* *psycopg2* - pip install psycopg2
+
+Setup
+----
+
+Set up a database in the Postgres, then run the logs_stats.sql inside so that it is populated (you will need to sort out permissions).
+
+Once this is done you should be able to run a local version of the bot.
+
+As it stands we try to keep all features in this plugin so everything is self contained
diff --git a/README.txt b/README.txt
deleted file mode 100644
index b500ba0..0000000
--- a/README.txt
+++ /dev/null
@@ -1 +0,0 @@
-This plugin automatically logs the channels where the bot is.
diff --git a/Untitled Diagram.drawio b/Untitled Diagram.drawio
new file mode 100644
index 0000000..2c7ccb7
--- /dev/null
+++ b/Untitled Diagram.drawio
@@ -0,0 +1 @@
+7Vvbkto4EP0aHkP5bvMYJjOzD7OpqZrU7uZR2AIrkS1KFgHy9SuB5AviIggzqGbMC1Zblu0+p0+3GzPw74rVIwXz/G+SQTzwnGw18L8MPM91Y59/Cct6awkTaZhRlMlJjeEF/YbS6EjrAmWw6kxkhGCG5l1jSsoSpqxjA5SSZXfalODuWedgBjXDSwqwbv0XZSxX9+U4zY6/IJrl8tRJKHdMQPpzRsmilOcbeP5089nuLoBaS86vcpCRZcvk3w/8O0oI224VqzuIhW+V27bHPRzYW183hSUzOcCbBDBxvdHE8bIgiaef5Aq/AF5IXzxzx8uLZWvloGqJCgxKPhrnrMDc6PLNNEc4ewJrshAnrxh3hhqNc0LRb1IyoCbz3ZRJ6PlVtme8iCO5WVg3zoSZHNX+EgMMJhCPa4/fEUwo31WSzXVVjJKfNXzijFO++AMoEBas/AfSDJRAmuV1JHwIMJqVfDvlLoR8vbHuU+UkSBlctUzSx4+QFJDRNZ+i9iYSbxkPsRwuG3JFakre4lWgJgJJ6Fm9dAMq35C4GmLsaRg/CSg9xzXE+Qh0EhrdZweZdtqJ0mmeodPc8DWc5iaac2DGRUMOCWU5mZES4PvGukPelgdPUZf797PQsR3bA8LKw20MQj6GZaaOSDGoKpR+y1G53SEPc7ej1kE/IGNrOQYLRripuZEnQuY14JfE0mkOSCZWZEFTeGBOKPUf0Bk8tE60nSMAOcokCjFg6FdX5a9Kk1CLLZ02GPM8JjBd5ojBlznY3PuSp9IuSWyUvoNiYqyFUVcKIz2q/T1B7b9GTEenwWowcE8D9l4gcr0uRmE0DEatT6xBFu+DLH6N3OVoEPUy/BYyHBvIcGKNDMd9ZO+N7FpH7YvsxL7M6dkFnu/bkzr3oXO5DnMn0fV/0r4ZfBeDYdhr9DkaPTLQaNVisUCkR71I743zwOLyy+/Lr5uEtgrb47HtWhPb6nqPBTeP17nYLFYz0UYeTuZFOZTGNk1E5KCUQyHo8kwqxBARQTghjJHiMI+a5muzxmcZwEygOp5Divi9ikj+QnNSTBbVc2Mad7q5M8DgEqwFORYMI0HHmpXrYkLE1XKYAcYQPy47tNfEyWr5CUN7ygxX70f3VeFOP8W1By5fQ0t2lvcEv0WdZde0H/86rWUv6pPq1ZOqKlSOJlXPJKn69iRVJQ7vvGJWMnJxwzIYDdsF8yi6XcXs6pqoa6Hm2y5GnSppiskyzXmEDjOYompTCu3F+Uj9cRxqi4D1dmqR0O8+Crnh7ZJdcCjZ6c9INiU7/7a/o3r976jni6gBDwKTfBeY5LvQnnynh9i7zHfqNi9v48dDp/3xb5fvPL2r9x1W14z5vll8HTEwebHCNX2zQhLzE4fBcaIOOeXIWC7k4s8E8ftrppDptOLXucvN+houlBiDFzY+THl2tg7pv0gJ+JtPFNyuPFOLfuBCo9UI3eLxB3lNDPetdy01ikzUKLanNDF4d6jvb1tZPAWBvaLlfpAXV84GLdQq3huWuIGGyUfLLNcvWdW758eShFGO8KzJEZ5eW34lPXVuQh3Vhj3KHdPyonnYGfkqW0hdqh8o7Hzc8fT8cuWn856T1+Wk6oGdQcpkFMQdUtrNSV//29FVukPDsN0f6rl5HjdN3ve26F1CX/9ptM+1t+KOUWfRtE5rJdtQNZf/SNe408G6NWEuVK7aI3uqyRWEnbOq58eHA/Pd8Oh8vrG9grcV2f7FzRsFg8lDy+iNdJQPm/+Wb2nV/IHfv/8f
\ No newline at end of file
diff --git a/__init__.py b/__init__.py
index bd57813..aa1fa40 100644
--- a/__init__.py
+++ b/__init__.py
@@ -44,9 +44,8 @@
# contributions.
__contributors__ = {}
-import config
-import plugin
-reload(plugin) # In case we're being reloaded.
+from . import config
+from . import plugin
# Add more reloads here if you add third-party modules and want them to be
# reloaded when this plugin is reloaded. Don't forget to import them as well!
diff --git a/channelLogger_model.py b/channelLogger_model.py
index 4fbffd3..46e4db7 100644
--- a/channelLogger_model.py
+++ b/channelLogger_model.py
@@ -2,8 +2,12 @@
import sys
import json
import os
+import string
import time
import psycopg2
+import logging
+import logging.handlers
+import re
class LogviewerDB:
@@ -12,19 +16,25 @@ def __init__(self):
if (hasattr(time, 'tzset')):
os.environ['TZ'] = 'Europe/London'
time.tzset()
-
+ fh = logging.handlers.TimedRotatingFileHandler('combined.log', when='midnight', interval=1, backupCount=5);
+ logging.basicConfig(level=logging.DEBUG, handlers=[fh], format="%(levelname)s: %(asctime)s - %(message)s")
+ self.__connect()
+
+ def __connect(self):
+ logging.debug("Attempting to connect with database...")
# DB connection string
try:
- with open('plugins/ChannelLogger/config.json') as data:
+ with open('plugins/LogsToDB/config.json') as data:
config = json.load(data)
conn_string = "host='%s' dbname='%s' user='%s' password='%s'" % (config['db']['host'], config['db']['dbname'], config['db']['user'], config['db']['password'])
except IOError as e:
- print os.getcwd()
+ print(os.getcwd())
+ logging.error("Error! No config file supplied, please create a config.json file in the root")
sys.exit("Error! No config file supplied, please create a config.json file in the root")
# Print connection string
- print "Connecting to database\n -> %s" % (conn_string)
+ print("Connecting to database\n -> %s" % (conn_string))
# get a connection
conn = psycopg2.connect(conn_string)
@@ -32,95 +42,196 @@ def __init__(self):
# conn.curser will return a cursor object, you can use this to perform queries
self.cursor = conn.cursor()
self.conn = conn
- print "connected!\n"
+ logging.debug("connected!")
+
+ def add_count(self, count, channel, topic):
+ count = str(count)
+ topic = str(topic)
+ channel_id = self.get_channel_id(channel)
+ try:
+ self.cursor.execute("INSERT INTO user_count (count, channel_id, topic) VALUES (%s, %s, %s)", (count, channel_id, topic))
+ self.conn.commit()
+ except psycopg2.InterfaceError as e:
+ logging.error('Error within add_count: ' + e.message)
+ logging.debug('Attempting to reconnect with database...')
+ self.__connect()
+
+ def add_message(self, user, host, msg, channel):
+ self.__add_message(user, host, msg, 'message', channel)
- def add_message(self, user, host, msg):
- self.__add_message(user, host, msg, 'message')
+ def add_join(self, user, host, channel):
+ self.__add_message(user, host, '', 'join', channel)
- def add_join(self, user, host):
- self.__add_message(user, host, '', 'join')
+ def add_part(self, user, host, channel):
+ self.__add_message(user, host, '', 'part', channel)
- def add_part(self, user, host):
- self.__add_message(user, host, '', 'part')
+ def add_quit(self, user, host, channel):
+ self.__add_message(user, host, '', 'quit', channel)
- def add_quit(self, user, host):
- self.__add_message(user, host, '', 'quit')
+ def add_emote(self, user, host, msg, channel):
+ self.__add_message(user, host, msg, 'emote', channel)
- def add_emote(self, user, host, msg,):
- self.__add_message(user, host, msg, 'emote')
- def __add_message(self, user, host, msg, action):
- # Was this message from a user we already have in our database?
- # If so return the userID.
- userID = self.check_user_host_exists(user, host) or False
- # If userID is False, store the new combo then get back the userID
- if not userID:
- self.cursor.execute("INSERT INTO users (\"user\", \"host\") VALUES (%s, %s)", (user, host))
+ def __add_message(self, user, host, msg, action, channel):
+
+ try:
+ # Was this message from a user we already have in our database?
+ # If so return the userID.
+ userID = self.check_user_host_exists(user, host) or False
+
+ # If userID is False, store the new combo then get back the userID
+ if not userID:
+ self.cursor.execute("INSERT INTO users (\"user\", \"host\") VALUES (%s, %s)", (user, host))
+ self.conn.commit()
+ # We should now have an ID for our new user/host combo
+ userID = self.check_user_host_exists(user, host);
+
+ # check channel exists, if not get_channel_id will generate an ID
+ channel_id = self.get_channel_id(channel)
+
+ if (action == 'message' or action == 'emote'):
+ self.cursor.execute("INSERT INTO messages (\"user\", \"content\", \"action\", \"channel_id\") VALUES (%s, %s, %s, %s)", (userID, msg, action, channel_id))
+ else:
+ self.cursor.execute("INSERT INTO messages (\"user\", \"action\", \"channel_id\") VALUES (%s, %s, %s)", (userID, action, channel_id))
+ self.conn.commit()
+ except psycopg2.InterfaceError as e:
+ logging.error('Error within add_message: ' + e.message)
+ logging.debug('Attempting to reconnect with database...')
+ self.__connect()
+
+ def write_ban(self, nick, host, mode, target, channel):
+ try:
+ # check channel exists, if not get_channel_id will generate an ID
+ channel_id = self.get_channel_id(channel)
+ # Sometimes users can be kicked to another channel because of join/quit floos, make sure we strip of the ban forwarding
+
+ if (len(re.split(r'(\$#.*)', target)) > 1):
+ banmask = re.split(r'(\$#.*)', target)[0]
+ forwarded_channel = re.sub('^\$', '', re.split(r'(\$#.*)', target)[1])
+ self.cursor.execute("INSERT INTO bans (banmask, banned_by, channel, reason) values (%s, %s, %s, %s)", (banmask, nick, channel_id, "Join/Quit flood, user forwarded to " + forwarded_channel))
+ else:
+ banmask = re.split(r'(\$#.*)', target)[0]
+ self.cursor.execute("INSERT INTO bans (banmask, banned_by, channel) values (%s, %s, %s)", (banmask, nick, channel_id))
+ self.conn.commit()
+ except psycopg2.InterfaceError as e:
+ logging.error('Error within write_ban: ' + e.message)
+ logging.debug('Attempting to reconnect with database...')
+ self.__connect()
+
+ def write_unban(self, nick, host, mode, target, channel):
+ try:
+ # check channel exists, if not get_channel_id will generate an ID
+ channel_id = self.get_channel_id(channel)
+ self.cursor.execute("UPDATE bans SET still_banned = FALSE WHERE channel = %s AND banmask = %s", (channel_id, target))
self.conn.commit()
- # We should now have an ID for our new user/host combo
- userID = self.check_user_host_exists(user, host);
+ except psycopg2.InterfaceError as e:
+ logging.error('Error within write_unban: ' + e.message)
+ logging.debug('Attempting to reconnect with database...')
+ self.__connect()
- if (action == 'message' or action == 'emote'):
- self.cursor.execute("INSERT INTO messages (\"user\", \"content\", \"action\") VALUES (%s, %s, %s)", (userID, msg, action))
- else:
- self.cursor.execute("INSERT INTO messages (\"user\", \"action\") VALUES (%s, %s)", (userID, action))
- self.conn.commit()
+ # UTILITY FUNCTIONS
# Check if user exists then return the user ID, if not return false
def check_user_host_exists(self, user, host):
- self.cursor.execute("SELECT * FROM users WHERE \"user\"= %s AND host=%s", (user, host))
- if self.cursor.rowcount:
- return self.cursor.fetchone()[1]
- else:
+ try:
+ self.cursor.execute("SELECT * FROM users WHERE \"user\"= %s AND \"host\"= %s", (user, host))
+ if self.cursor.rowcount:
+ return self.cursor.fetchone()[0]
+ else:
+ return False
+ except psycopg2.InterfaceError as e:
+ logging.error('Error within check_user_host_exists: ' + e.message)
+ logging.debug('Attempting to reconnect with database...')
+ self.__connect()
+
+
+ def get_channel_id(self, channel):
+ try:
+ self.cursor.execute("SELECT id FROM channels WHERE channel_name = %s", (channel,))
+ if self.cursor.rowcount:
+ return self.cursor.fetchone()[0]
+ else:
+ self.cursor.execute("INSERT INTO channels (channel_name) VALUES (%s)", (channel,))
+ self.conn.commit()
+ return self.get_channel_id(channel)
+ except psycopg2.InterfaceError as e:
+ logging.error('Error within get_channel_id: ' + e.message)
+ logging.debug('Attempting to reconnect with database...')
+ self.__connect()
+
+ # Probably don't need this actually
+ def get_banned_row_id(self, banmask):
+ try:
+ self.cursor.execute("SELECT id FROM bans WHERE banmask = %s", (banmask,))
+ if self.cursor.rowcount:
+ return self.cursor.fetchone()[0]
+
return False
+ except psycopg2.InterfaceError as e:
+ logging.error('Error within get_banned_row_id: ' + e.message)
+ logging.debug('Attempting to reconnect with database...')
+ self.__connect()
- def resetData(self):
- self.cursor.execute("DELETE FROM users;")
- self.cursor.execute("DELETE FROM messages;")
- self.cursor.execute("ALTER SEQUENCE messages_id_seq RESTART WITH 1;")
- self.cursor.execute("ALTER SEQUENCE users_id_seq RESTART WITH 1;")
- self.conn.commit()
class LogviewerFile:
def __init__(self):
# Get Logfile Path
try:
- with open('plugins/ChannelLogger/config.json') as data:
+ with open('plugins/LogsToDB/config.json') as data:
config = json.load(data)
self.logPath = config['logs']['folderPath']
except IOError as e:
sys.exit("Error! No config file supplied, please create a config.json file in the root")
+ # self.all_bytes = string.maketrans('', '')
+
def write_message(self, user, msg):
time_stamp = time.strftime("%H:%M:%S")
dateStamp = time.strftime("%Y-%m-%d")
with open(self.logPath + "/%s.log" % dateStamp, 'a') as logFile:
- logFile.write("%s <%s> %s \n" % (time_stamp, user, msg))
+ msg = "%s <%s> %s\n" % (time_stamp, user, msg)
+ logFile.write(msg)
def write_join(self, user, host, channel):
time_stamp = time.strftime("%H:%M:%S")
dateStamp = time.strftime("%Y-%m-%d")
with open(self.logPath + "/%s.log" % dateStamp, 'a') as logFile:
- logFile.write("%s --> <%s> (%s) joins %s \n" % (time_stamp, user, host, channel))
+ msg = "%s --> <%s> (%s) joins %s \n" % (time_stamp, user, host, channel)
+ logFile.write(msg)
def write_part(self, user, host, channel):
time_stamp = time.strftime("%H:%M:%S")
dateStamp = time.strftime("%Y-%m-%d")
with open(self.logPath + "/%s.log" % dateStamp, 'a') as logFile:
- logFile.write("%s <-- <%s> (%s) parts %s \n" % (time_stamp, user, host, channel))
+ msg = "%s <-- <%s> (%s) parts %s \n" % (time_stamp, user, host, channel)
+ logFile.write(msg)
def write_quit(self, user, host, channel):
time_stamp = time.strftime("%H:%M:%S")
dateStamp = time.strftime("%Y-%m-%d")
with open(self.logPath + "/%s.log" % dateStamp, 'a') as logFile:
- logFile.write("%s <-- <%s> (%s) quits %s \n" % (time_stamp, user, host, channel))
+ msg = "%s <-- <%s> (%s) quits %s \n" % (time_stamp, user, host, channel)
+ logFile.write(msg)
+ def write_kick(self, target, nick, channel):
+ time_stamp = time.strftime("%H:%M:%S")
+ dateStamp = time.strftime("%Y-%m-%d")
+ with open(self.logPath + "/%s.log" % dateStamp, 'a') as logFile:
+ msg = "%s %s has kicked %s from %s \n" % (time_stamp, nick, target, channel)
+ logFile.write(msg)
-def main():
- logviewerDB = LogviewerDB()
- logviewerDB.resetData();
+ def write_ban(self, nick, host, mode, target, channel):
+ time_stamp = time.strftime("%H:%M:%S")
+ dateStamp = time.strftime("%Y-%m-%d")
+ with open(self.logPath + "/%s.log" % dateStamp, 'a') as logFile:
+ msg = '%s %s sets mode: %s %s\n' % (time_stamp, nick, mode, target)
+ logFile.write(msg)
-if __name__ == "__main__":
- main()
\ No newline at end of file
+ def write_unban(self, nick, host, mode, target, channel):
+ time_stamp = time.strftime("%H:%M:%S")
+ dateStamp = time.strftime("%Y-%m-%d")
+ with open(self.logPath + "/%s.log" % dateStamp, 'a') as logFile:
+ msg = '%s %s sets mode: %s %s\n' % (time_stamp, nick, mode, target)
+ logFile.write(msg)
diff --git a/config.py b/config.py
index 1cf78a8..b86ed83 100644
--- a/config.py
+++ b/config.py
@@ -1,94 +1,94 @@
-###
-# Copyright (c) 2005, Jeremiah Fincher
-# Copyright (c) 2009, James McCoy
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# * Redistributions of source code must retain the above copyright notice,
-# this list of conditions, and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions, and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# * Neither the name of the author of this software nor the name of
-# contributors to this software may be used to endorse or promote products
-# derived from this software without specific prior written consent.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-###
-
-import supybot.conf as conf
-import supybot.registry as registry
-from supybot.i18n import PluginInternationalization, internationalizeDocstring
-_ = PluginInternationalization('ChannelLogger')
-
-def configure(advanced):
- # This will be called by supybot to configure this module. advanced is
- # a bool that specifies whether the user identified himself as an advanced
- # user or not. You should effect your configuration by manipulating the
- # registry as appropriate.
- from supybot.questions import expect, anything, something, yn
- conf.registerPlugin('ChannelLogger', True)
-
-ChannelLogger = conf.registerPlugin('ChannelLogger')
-conf.registerChannelValue(ChannelLogger, 'enable',
- registry.Boolean(True, _("""Determines whether logging is enabled.""")))
-conf.registerGlobalValue(ChannelLogger, 'flushImmediately',
- registry.Boolean(False, _("""Determines whether channel logfiles will be
- flushed anytime they're written to, rather than being buffered by the
- operating system.""")))
-conf.registerChannelValue(ChannelLogger, 'showJoinParts',
- registry.Boolean(True, _("""Determines wether joins and parts are logged""")))
-conf.registerChannelValue(ChannelLogger, 'stripFormatting',
- registry.Boolean(True, _("""Determines whether formatting characters (such
- as bolding, color, etc.) are removed when writing the logs to disk.""")))
-conf.registerChannelValue(ChannelLogger, 'timestamp',
- registry.Boolean(True, _("""Determines whether the logs for this channel are
- timestamped with the timestamp in supybot.log.timestampFormat.""")))
-conf.registerChannelValue(ChannelLogger, 'noLogPrefix',
- registry.String('[nolog]', _("""Determines what string a message should be
- prefixed with in order not to be logged. If you don't want any such
- prefix, just set it to the empty string.""")))
-conf.registerChannelValue(ChannelLogger, 'rotateLogs',
- registry.Boolean(False, _("""Determines whether the bot will automatically
- rotate the logs for this channel. The bot will rotate logs when the
- timestamp for the log changes. The timestamp is set according to
- the 'filenameTimestamp' configuration variable.""")))
-conf.registerChannelValue(ChannelLogger, 'filenameTimestamp',
- registry.String('%Y-%m-%d', _("""Determines how to represent the timestamp
- used for the filename in rotated logs. When this timestamp changes, the
- old logfiles will be closed and a new one started. The format characters
- for the timestamp are in the time.strftime docs at python.org. In order
- for your logs to be rotated, you'll also have to enable
- supybot.plugins.ChannelLogger.rotateLogs.""")))
-
-conf.registerGlobalValue(ChannelLogger, 'directories',
- registry.Boolean(True, _("""Determines whether the bot will partition its
- channel logs into separate directories based on different criteria.""")))
-conf.registerGlobalValue(ChannelLogger.directories, 'network',
- registry.Boolean(True, _("""Determines whether the bot will use a network
- directory if using directories.""")))
-conf.registerGlobalValue(ChannelLogger.directories, 'channel',
- registry.Boolean(True, _("""Determines whether the bot will use a channel
- directory if using directories.""")))
-conf.registerGlobalValue(ChannelLogger.directories, 'timestamp',
- registry.Boolean(False, _("""Determines whether the bot will use a timestamp
- (determined by supybot.plugins.ChannelLogger.directories.timestamp.format)
- if using directories.""")))
-conf.registerGlobalValue(ChannelLogger.directories.timestamp, 'format',
- registry.String('%B', _("""Determines what timestamp format will be used in
- the directory structure for channel logs if
- supybot.plugins.ChannelLogger.directories.timestamp is True.""")))
-
-# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
+###
+# Copyright (c) 2005, Jeremiah Fincher
+# Copyright (c) 2009, James McCoy
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions, and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions, and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the author of this software nor the name of
+# contributors to this software may be used to endorse or promote products
+# derived from this software without specific prior written consent.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+###
+
+import supybot.conf as conf
+import supybot.registry as registry
+from supybot.i18n import PluginInternationalization, internationalizeDocstring
+_ = PluginInternationalization('LogsToDB')
+
+def configure(advanced):
+ # This will be called by supybot to configure this module. advanced is
+ # a bool that specifies whether the user identified himself as an advanced
+ # user or not. You should effect your configuration by manipulating the
+ # registry as appropriate.
+ from supybot.questions import expect, anything, something, yn
+ conf.registerPlugin('LogsToDB', True)
+
+LogsToDB = conf.registerPlugin('LogsToDB')
+conf.registerChannelValue(LogsToDB, 'enable',
+ registry.Boolean(True, _("""Determines whether logging is enabled.""")))
+conf.registerGlobalValue(LogsToDB, 'flushImmediately',
+ registry.Boolean(False, _("""Determines whether channel logfiles will be
+ flushed anytime they're written to, rather than being buffered by the
+ operating system.""")))
+conf.registerChannelValue(LogsToDB, 'showJoinParts',
+ registry.Boolean(True, _("""Determines wether joins and parts are logged""")))
+conf.registerChannelValue(LogsToDB, 'stripFormatting',
+ registry.Boolean(True, _("""Determines whether formatting characters (such
+ as bolding, color, etc.) are removed when writing the logs to disk.""")))
+conf.registerChannelValue(LogsToDB, 'timestamp',
+ registry.Boolean(True, _("""Determines whether the logs for this channel are
+ timestamped with the timestamp in supybot.log.timestampFormat.""")))
+conf.registerChannelValue(LogsToDB, 'noLogPrefix',
+ registry.String('[nolog]', _("""Determines what string a message should be
+ prefixed with in order not to be logged. If you don't want any such
+ prefix, just set it to the empty string.""")))
+conf.registerChannelValue(LogsToDB, 'rotateLogs',
+ registry.Boolean(False, _("""Determines whether the bot will automatically
+ rotate the logs for this channel. The bot will rotate logs when the
+ timestamp for the log changes. The timestamp is set according to
+ the 'filenameTimestamp' configuration variable.""")))
+conf.registerChannelValue(LogsToDB, 'filenameTimestamp',
+ registry.String('%Y-%m-%d', _("""Determines how to represent the timestamp
+ used for the filename in rotated logs. When this timestamp changes, the
+ old logfiles will be closed and a new one started. The format characters
+ for the timestamp are in the time.strftime docs at python.org. In order
+ for your logs to be rotated, you'll also have to enable
+ supybot.plugins.LogsToDB.rotateLogs.""")))
+
+conf.registerGlobalValue(LogsToDB, 'directories',
+ registry.Boolean(True, _("""Determines whether the bot will partition its
+ channel logs into separate directories based on different criteria.""")))
+conf.registerGlobalValue(LogsToDB.directories, 'network',
+ registry.Boolean(True, _("""Determines whether the bot will use a network
+ directory if using directories.""")))
+conf.registerGlobalValue(LogsToDB.directories, 'channel',
+ registry.Boolean(True, _("""Determines whether the bot will use a channel
+ directory if using directories.""")))
+conf.registerGlobalValue(LogsToDB.directories, 'timestamp',
+ registry.Boolean(False, _("""Determines whether the bot will use a timestamp
+ (determined by supybot.plugins.LogsToDB.directories.timestamp.format)
+ if using directories.""")))
+conf.registerGlobalValue(LogsToDB.directories.timestamp, 'format',
+ registry.String('%B', _("""Determines what timestamp format will be used in
+ the directory structure for channel logs if
+ supybot.plugins.LogsToDB.directories.timestamp is True.""")))
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
diff --git a/locales/fi.po b/locales/fi.po
index 5e5ae1c..950fb04 100644
--- a/locales/fi.po
+++ b/locales/fi.po
@@ -1,136 +1,136 @@
-# ChannelLogger plugin in Limnoria.
-# Copyright (C) 2011, 2012 Limnoria
-# Mika Suomalainen , 2011, 2012.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: Supybot Channellogger\n"
-"POT-Creation-Date: 2012-10-07 18:37+EEST\n"
-"PO-Revision-Date: 2012-10-07 18:39+0200\n"
-"Last-Translator: Mika Suomalainen \n"
-"Language-Team: suomi <>\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Poedit-Language: Finnish\n"
-"X-Poedit-Country: FINLAND\n"
-"Plural-Forms: \n"
-"X-Generator: Gtranslator 2.91.5\n"
-
-#: config.py:46
-msgid "Determines whether logging is enabled."
-msgstr "Määrittää onko lokin pitäminen käytössä."
-
-#: config.py:48
-msgid ""
-"Determines whether channel logfiles will be\n"
-" flushed anytime they're written to, rather than being buffered by the\n"
-" operating system."
-msgstr ""
-"Määrittää pitäisikö kanava lokitiedostot\n"
-" tallentaa silloin kun ne kirjoitetaan, mielummin kuin käyttöjärjestelmän\n"
-" puskuroimana."
-
-#: config.py:52
-msgid "Determines wether joins and parts are logged"
-msgstr "Määrittää kirjoitetaanko liittymiset ja poistumiset lokiin"
-
-#: config.py:54
-msgid ""
-"Determines whether formatting characters (such\n"
-" as bolding, color, etc.) are removed when writing the logs to disk."
-msgstr ""
-"Määrittää pitääkö muotoilumerkit (kuten\n"
-"korostukset, väri, jne.) poistaa kun lokeja kirjoitetaan levylle."
-
-#: config.py:57
-msgid ""
-"Determines whether the logs for this channel are\n"
-" timestamped with the timestamp in supybot.log.timestampFormat."
-msgstr ""
-"Määrittää laitetaanko tämän kanavan lokitiedostoihin\n"
-" aikaleimat aikaleimalla, joka on määritetty asetuksella supybot.log.timestampFormat."
-
-#: config.py:60
-msgid ""
-"Determines what string a message should be\n"
-" prefixed with in order not to be logged. If you don't want any such\n"
-" prefix, just set it to the empty string."
-msgstr ""
-"Määrittää millä merkkiketjulla aloitettuja viestejä\n"
-" ei tallenneta lokiin. Jos et halua\n"
-" merkkiketjua, aseta se tyhjäksi merkkiketjuksi."
-
-#: config.py:64
-msgid ""
-"Determines whether the bot will automatically\n"
-" rotate the logs for this channel. The bot will rotate logs when the\n"
-" timestamp for the log changes. The timestamp is set according to\n"
-" the 'filenameTimestamp' configuration variable."
-msgstr ""
-"Määrittää kääntääkö botti automaattisesti\n"
-" lokit tällä kanavalla. Botti kääntää lokit kun\n"
-" kun aikaleima lokeille vaihtuu. Aikaleima asetetaan\n"
-" 'filenameTimestamp' asetusarvon mukaan."
-
-#: config.py:69
-msgid ""
-"Determines how to represent the timestamp\n"
-" used for the filename in rotated logs. When this timestamp changes, the\n"
-" old logfiles will be closed and a new one started. The format characters\n"
-" for the timestamp are in the time.strftime docs at python.org. In order\n"
-" for your logs to be rotated, you'll also have to enable\n"
-" supybot.plugins.ChannelLogger.rotateLogs."
-msgstr ""
-"Määrittää kuinka aikaleima, jota käytetään\n"
-" tiedostonimenä käännetyille lokeille, esitetään. Kun tämä aikaleima muuttuu\n"
-" vanhat lokitiedostot suljetaan ja uudet aloitetaan. Muotomerkit\n"
-" aikaleimoille ovat time.strftime documenteissa python.org :issa. Saadaksesi\n"
-" lokisi käännetyksi, sinun täytyy myös ottaa käyttöön\n"
-" supybot.plugins.ChannelLogger.rotateLogs."
-
-#: config.py:77
-msgid ""
-"Determines whether the bot will partition its\n"
-" channel logs into separate directories based on different criteria."
-msgstr ""
-"Määrittää osioiko botti kanavalokinsa\n"
-" eri hakemistoihin perustuen eri kriteereihin."
-
-#: config.py:80
-msgid ""
-"Determines whether the bot will use a network\n"
-" directory if using directories."
-msgstr ""
-"Määrittää käyttääkö botti verkkohakemistoa\n"
-" jos käytetään hakemistoja."
-
-#: config.py:83
-msgid ""
-"Determines whether the bot will use a channel\n"
-" directory if using directories."
-msgstr ""
-"Määrittää käyttääkö botti kanavahakemistoa\n"
-" jos käytetään hakemistoja."
-
-#: config.py:86
-msgid ""
-"Determines whether the bot will use a timestamp\n"
-" (determined by supybot.plugins.ChannelLogger.directories.timestamp.format)\n"
-" if using directories."
-msgstr ""
-"Määrittää käyttääkö botti aikaleimaa\n"
-" (supybot.plugins.ChannelLogger.directories.timestamp.format määrittämänä\n"
-" jos käytetään hakemistoja."
-
-#: config.py:90
-msgid ""
-"Determines what timestamp format will be used in\n"
-" the directory structure for channel logs if\n"
-" supybot.plugins.ChannelLogger.directories.timestamp is True."
-msgstr ""
-"Määrittää mitä aikaleimamuotoa käytetään\n"
-" hakemistorakenteessa kanavalokeille jos\n"
-" supybot.plugins.ChannelLogger.directories.timestamp on True."
-
+# ChannelLogger plugin in Limnoria.
+# Copyright (C) 2011, 2012 Limnoria
+# Mika Suomalainen , 2011, 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Supybot Channellogger\n"
+"POT-Creation-Date: 2012-10-07 18:37+EEST\n"
+"PO-Revision-Date: 2012-10-07 18:39+0200\n"
+"Last-Translator: Mika Suomalainen \n"
+"Language-Team: suomi <>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: Finnish\n"
+"X-Poedit-Country: FINLAND\n"
+"Plural-Forms: \n"
+"X-Generator: Gtranslator 2.91.5\n"
+
+#: config.py:46
+msgid "Determines whether logging is enabled."
+msgstr "Määrittää onko lokin pitäminen käytössä."
+
+#: config.py:48
+msgid ""
+"Determines whether channel logfiles will be\n"
+" flushed anytime they're written to, rather than being buffered by the\n"
+" operating system."
+msgstr ""
+"Määrittää pitäisikö kanava lokitiedostot\n"
+" tallentaa silloin kun ne kirjoitetaan, mielummin kuin käyttöjärjestelmän\n"
+" puskuroimana."
+
+#: config.py:52
+msgid "Determines wether joins and parts are logged"
+msgstr "Määrittää kirjoitetaanko liittymiset ja poistumiset lokiin"
+
+#: config.py:54
+msgid ""
+"Determines whether formatting characters (such\n"
+" as bolding, color, etc.) are removed when writing the logs to disk."
+msgstr ""
+"Määrittää pitääkö muotoilumerkit (kuten\n"
+"korostukset, väri, jne.) poistaa kun lokeja kirjoitetaan levylle."
+
+#: config.py:57
+msgid ""
+"Determines whether the logs for this channel are\n"
+" timestamped with the timestamp in supybot.log.timestampFormat."
+msgstr ""
+"Määrittää laitetaanko tämän kanavan lokitiedostoihin\n"
+" aikaleimat aikaleimalla, joka on määritetty asetuksella supybot.log.timestampFormat."
+
+#: config.py:60
+msgid ""
+"Determines what string a message should be\n"
+" prefixed with in order not to be logged. If you don't want any such\n"
+" prefix, just set it to the empty string."
+msgstr ""
+"Määrittää millä merkkiketjulla aloitettuja viestejä\n"
+" ei tallenneta lokiin. Jos et halua\n"
+" merkkiketjua, aseta se tyhjäksi merkkiketjuksi."
+
+#: config.py:64
+msgid ""
+"Determines whether the bot will automatically\n"
+" rotate the logs for this channel. The bot will rotate logs when the\n"
+" timestamp for the log changes. The timestamp is set according to\n"
+" the 'filenameTimestamp' configuration variable."
+msgstr ""
+"Määrittää kääntääkö botti automaattisesti\n"
+" lokit tällä kanavalla. Botti kääntää lokit kun\n"
+" kun aikaleima lokeille vaihtuu. Aikaleima asetetaan\n"
+" 'filenameTimestamp' asetusarvon mukaan."
+
+#: config.py:69
+msgid ""
+"Determines how to represent the timestamp\n"
+" used for the filename in rotated logs. When this timestamp changes, the\n"
+" old logfiles will be closed and a new one started. The format characters\n"
+" for the timestamp are in the time.strftime docs at python.org. In order\n"
+" for your logs to be rotated, you'll also have to enable\n"
+" supybot.plugins.ChannelLogger.rotateLogs."
+msgstr ""
+"Määrittää kuinka aikaleima, jota käytetään\n"
+" tiedostonimenä käännetyille lokeille, esitetään. Kun tämä aikaleima muuttuu\n"
+" vanhat lokitiedostot suljetaan ja uudet aloitetaan. Muotomerkit\n"
+" aikaleimoille ovat time.strftime documenteissa python.org :issa. Saadaksesi\n"
+" lokisi käännetyksi, sinun täytyy myös ottaa käyttöön\n"
+" supybot.plugins.ChannelLogger.rotateLogs."
+
+#: config.py:77
+msgid ""
+"Determines whether the bot will partition its\n"
+" channel logs into separate directories based on different criteria."
+msgstr ""
+"Määrittää osioiko botti kanavalokinsa\n"
+" eri hakemistoihin perustuen eri kriteereihin."
+
+#: config.py:80
+msgid ""
+"Determines whether the bot will use a network\n"
+" directory if using directories."
+msgstr ""
+"Määrittää käyttääkö botti verkkohakemistoa\n"
+" jos käytetään hakemistoja."
+
+#: config.py:83
+msgid ""
+"Determines whether the bot will use a channel\n"
+" directory if using directories."
+msgstr ""
+"Määrittää käyttääkö botti kanavahakemistoa\n"
+" jos käytetään hakemistoja."
+
+#: config.py:86
+msgid ""
+"Determines whether the bot will use a timestamp\n"
+" (determined by supybot.plugins.ChannelLogger.directories.timestamp.format)\n"
+" if using directories."
+msgstr ""
+"Määrittää käyttääkö botti aikaleimaa\n"
+" (supybot.plugins.ChannelLogger.directories.timestamp.format määrittämänä\n"
+" jos käytetään hakemistoja."
+
+#: config.py:90
+msgid ""
+"Determines what timestamp format will be used in\n"
+" the directory structure for channel logs if\n"
+" supybot.plugins.ChannelLogger.directories.timestamp is True."
+msgstr ""
+"Määrittää mitä aikaleimamuotoa käytetään\n"
+" hakemistorakenteessa kanavalokeille jos\n"
+" supybot.plugins.ChannelLogger.directories.timestamp on True."
+
diff --git a/locales/fr.po b/locales/fr.po
index dbf122b..8212b16 100644
--- a/locales/fr.po
+++ b/locales/fr.po
@@ -1,129 +1,129 @@
-msgid ""
-msgstr ""
-"Project-Id-Version: Supybot-fr\n"
-"POT-Creation-Date: 2013-03-02 19:04+CET\n"
-"PO-Revision-Date: \n"
-"Last-Translator: Valentin Lorentz \n"
-"Language-Team: Supybot-fr \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Poedit-SourceCharset: ASCII\n"
-"X-Generator: Poedit 1.5.4\n"
-
-#: config.py:46
-msgid "Determines whether logging is enabled."
-msgstr "Détermine si les logs sont activés."
-
-#: config.py:48
-msgid ""
-"Determines whether channel logfiles will be\n"
-" flushed anytime they're written to, rather than being buffered by the\n"
-" operating system."
-msgstr ""
-"Détermine si le fichier de logs sera enregistré à chaque fois que l'on y "
-"écrit plutôt que d'être mis en buffer par le système d'exploitation."
-
-#: config.py:52
-msgid "Determines wether joins and parts are logged"
-msgstr "Détermine si les arrivées et les départs sont loggués."
-
-#: config.py:54
-msgid ""
-"Determines whether formatting characters (such\n"
-" as bolding, color, etc.) are removed when writing the logs to disk."
-msgstr ""
-"Détermine si les caractères de formattage (comme le gras, la couleurs) sont "
-"supprimés lors de l'écriture des logs sur le disque."
-
-#: config.py:57
-msgid ""
-"Determines whether the logs for this channel are\n"
-" timestamped with the timestamp in supybot.log.timestampFormat."
-msgstr ""
-"Détermine si les logs de ce canal sont 'timestampés' avec le format dans "
-"supybot.log.timestampFormat"
-
-#: config.py:60
-msgid ""
-"Determines what string a message should be\n"
-" prefixed with in order not to be logged. If you don't want any such\n"
-" prefix, just set it to the empty string."
-msgstr ""
-"Détermine par quelle chaîne un message doit être préfixé pour ne pas être "
-"loggué. Vous ne voulez probablement pas d'un tel préfixe, et simplement "
-"définir une chaîne vide."
-
-#: config.py:64
-msgid ""
-"Determines whether the bot will automatically\n"
-" rotate the logs for this channel. The bot will rotate logs when the\n"
-" timestamp for the log changes. The timestamp is set according to\n"
-" the 'filenameTimestamp' configuration variable."
-msgstr ""
-"Détermine si le bot fera automatiquement une rotation des logs pour ce "
-"canal. Le bot fera tourner les logs lorsque leur timestamp changera. Le "
-"timestamp est défini par la variable de configuration 'filenameTimestamp'."
-
-#: config.py:69
-msgid ""
-"Determines how to represent the timestamp\n"
-" used for the filename in rotated logs. When this timestamp changes, "
-"the\n"
-" old logfiles will be closed and a new one started. The format "
-"characters\n"
-" for the timestamp are in the time.strftime docs at python.org. In "
-"order\n"
-" for your logs to be rotated, you'll also have to enable\n"
-" supybot.plugins.ChannelLogger.rotateLogs."
-msgstr ""
-"Détermine comment représenter le timestamp utilisé pour les noms de fichiers "
-"de logs 'tournants'. Lorsque ce timestamp change, l'ancien fichier de logs "
-"sera fermé, et un nouveau sera ouvert. Le format du timestamp est le même "
-"que celui de time.strftime (documentation disponible sur python.org). Pour "
-"avoir des logs 'tournant', vous devez activer supybot.plugins.ChannelLogger."
-"rotateLogs."
-
-#: config.py:77
-msgid ""
-"Determines whether the bot will partition its\n"
-" channel logs into separate directories based on different criteria."
-msgstr ""
-"Détermine si le bot partitionnera les logs de canaux dans des répertoires "
-"séparés, en fonction de différents critères."
-
-#: config.py:80
-msgid ""
-"Determines whether the bot will use a network\n"
-" directory if using directories."
-msgstr ""
-"Détermine si le bot utilisera un répertoire par réseau, si il utilise des "
-"répertoires."
-
-#: config.py:83
-msgid ""
-"Determines whether the bot will use a channel\n"
-" directory if using directories."
-msgstr ""
-"Détermine si le bot utilisera un répertoire par canal, si il utilise des "
-"répertoires."
-
-#: config.py:86
-msgid ""
-"Determines whether the bot will use a timestamp\n"
-" (determined by supybot.plugins.ChannelLogger.directories.timestamp."
-"format)\n"
-" if using directories."
-msgstr ""
-"Détermine si le bot utilisera un timestamp (déterminé par supybot.plugins."
-"ChannelLogger.directories.timestamp.format), si il utilise des répertoires."
-
-#: config.py:90
-msgid ""
-"Determines what timestamp format will be used in\n"
-" the directory structure for channel logs if\n"
-" supybot.plugins.ChannelLogger.directories.timestamp is True."
-msgstr ""
-"Détermine quel format de timestamp sera utilisé dans la structure de "
-"répertoires pour les logs de canaux si supybot.plugins.ChannelLogger."
-"directories.timestamp est True."
+msgid ""
+msgstr ""
+"Project-Id-Version: Supybot-fr\n"
+"POT-Creation-Date: 2013-03-02 19:04+CET\n"
+"PO-Revision-Date: \n"
+"Last-Translator: Valentin Lorentz \n"
+"Language-Team: Supybot-fr \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-SourceCharset: ASCII\n"
+"X-Generator: Poedit 1.5.4\n"
+
+#: config.py:46
+msgid "Determines whether logging is enabled."
+msgstr "Détermine si les logs sont activés."
+
+#: config.py:48
+msgid ""
+"Determines whether channel logfiles will be\n"
+" flushed anytime they're written to, rather than being buffered by the\n"
+" operating system."
+msgstr ""
+"Détermine si le fichier de logs sera enregistré à chaque fois que l'on y "
+"écrit plutôt que d'être mis en buffer par le système d'exploitation."
+
+#: config.py:52
+msgid "Determines wether joins and parts are logged"
+msgstr "Détermine si les arrivées et les départs sont loggués."
+
+#: config.py:54
+msgid ""
+"Determines whether formatting characters (such\n"
+" as bolding, color, etc.) are removed when writing the logs to disk."
+msgstr ""
+"Détermine si les caractères de formattage (comme le gras, la couleurs) sont "
+"supprimés lors de l'écriture des logs sur le disque."
+
+#: config.py:57
+msgid ""
+"Determines whether the logs for this channel are\n"
+" timestamped with the timestamp in supybot.log.timestampFormat."
+msgstr ""
+"Détermine si les logs de ce canal sont 'timestampés' avec le format dans "
+"supybot.log.timestampFormat"
+
+#: config.py:60
+msgid ""
+"Determines what string a message should be\n"
+" prefixed with in order not to be logged. If you don't want any such\n"
+" prefix, just set it to the empty string."
+msgstr ""
+"Détermine par quelle chaîne un message doit être préfixé pour ne pas être "
+"loggué. Vous ne voulez probablement pas d'un tel préfixe, et simplement "
+"définir une chaîne vide."
+
+#: config.py:64
+msgid ""
+"Determines whether the bot will automatically\n"
+" rotate the logs for this channel. The bot will rotate logs when the\n"
+" timestamp for the log changes. The timestamp is set according to\n"
+" the 'filenameTimestamp' configuration variable."
+msgstr ""
+"Détermine si le bot fera automatiquement une rotation des logs pour ce "
+"canal. Le bot fera tourner les logs lorsque leur timestamp changera. Le "
+"timestamp est défini par la variable de configuration 'filenameTimestamp'."
+
+#: config.py:69
+msgid ""
+"Determines how to represent the timestamp\n"
+" used for the filename in rotated logs. When this timestamp changes, "
+"the\n"
+" old logfiles will be closed and a new one started. The format "
+"characters\n"
+" for the timestamp are in the time.strftime docs at python.org. In "
+"order\n"
+" for your logs to be rotated, you'll also have to enable\n"
+" supybot.plugins.ChannelLogger.rotateLogs."
+msgstr ""
+"Détermine comment représenter le timestamp utilisé pour les noms de fichiers "
+"de logs 'tournants'. Lorsque ce timestamp change, l'ancien fichier de logs "
+"sera fermé, et un nouveau sera ouvert. Le format du timestamp est le même "
+"que celui de time.strftime (documentation disponible sur python.org). Pour "
+"avoir des logs 'tournant', vous devez activer supybot.plugins.ChannelLogger."
+"rotateLogs."
+
+#: config.py:77
+msgid ""
+"Determines whether the bot will partition its\n"
+" channel logs into separate directories based on different criteria."
+msgstr ""
+"Détermine si le bot partitionnera les logs de canaux dans des répertoires "
+"séparés, en fonction de différents critères."
+
+#: config.py:80
+msgid ""
+"Determines whether the bot will use a network\n"
+" directory if using directories."
+msgstr ""
+"Détermine si le bot utilisera un répertoire par réseau, si il utilise des "
+"répertoires."
+
+#: config.py:83
+msgid ""
+"Determines whether the bot will use a channel\n"
+" directory if using directories."
+msgstr ""
+"Détermine si le bot utilisera un répertoire par canal, si il utilise des "
+"répertoires."
+
+#: config.py:86
+msgid ""
+"Determines whether the bot will use a timestamp\n"
+" (determined by supybot.plugins.ChannelLogger.directories.timestamp."
+"format)\n"
+" if using directories."
+msgstr ""
+"Détermine si le bot utilisera un timestamp (déterminé par supybot.plugins."
+"ChannelLogger.directories.timestamp.format), si il utilise des répertoires."
+
+#: config.py:90
+msgid ""
+"Determines what timestamp format will be used in\n"
+" the directory structure for channel logs if\n"
+" supybot.plugins.ChannelLogger.directories.timestamp is True."
+msgstr ""
+"Détermine quel format de timestamp sera utilisé dans la structure de "
+"répertoires pour les logs de canaux si supybot.plugins.ChannelLogger."
+"directories.timestamp est True."
diff --git a/locales/hu.po b/locales/hu.po
index cd4b2e4..255bd1f 100644
--- a/locales/hu.po
+++ b/locales/hu.po
@@ -1,97 +1,97 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR ORGANIZATION
-# FIRST AUTHOR , YEAR.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: Limnoria ChannelLogger\n"
-"POT-Creation-Date: 2011-08-10 11:27+CEST\n"
-"PO-Revision-Date: 2011-08-19 16:21+0200\n"
-"Last-Translator: nyuszika7h \n"
-"Language-Team: \n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: pygettext.py 1.5\n"
-
-#: config.py:46
-msgid "Determines whether logging is enabled."
-msgstr "Meghatározza, hogy a naplózás engedélyezve van-e."
-
-#: config.py:48
-msgid ""
-"Determines whether channel logfiles will be\n"
-" flushed anytime they're written to, rather than being buffered by the\n"
-" operating system."
-msgstr "Meghatározza, hogy a csatorna naplófájlok mentve legyenek-e, amikor írva vannak, ahelyett, hogy az operációs rendszer pufferelje őket."
-
-#: config.py:52
-msgid ""
-"Determines whether formatting characters (such\n"
-" as bolding, color, etc.) are removed when writing the logs to disk."
-msgstr "Meghatározza, hogy milyen formázási karakterek (olyan, mint félkövér, szín stb.) vannak eltávolítva a naplófájlok lemezre írásakor."
-
-#: config.py:55
-msgid ""
-"Determines whether the logs for this channel are\n"
-" timestamped with the timestamp in supybot.log.timestampFormat."
-msgstr "Meghatározza, hogy a csatorna naplójai el legyenek-e látva a supybot.log.timestampFormat-ban lévő időbélyegzővel."
-
-#: config.py:58
-msgid ""
-"Determines what string a message should be\n"
-" prefixed with in order not to be logged. If you don't want any such\n"
-" prefix, just set it to the empty string."
-msgstr "Meghatározza, hogy milyen karakterlánccal kell kezdődnie egy üzenetnek, hogy ne legyen naplózva. Ha nem szeretnél semmi ilyen előtagot, csak állítsd üres karakterláncra."
-
-#: config.py:62
-msgid ""
-"Determines whether the bot will automatically\n"
-" rotate the logs for this channel. The bot will rotate logs when the\n"
-" timestamp for the log changes. The timestamp is set according to\n"
-" the 'filenameTimestamp' configuration variable."
-msgstr "Meghatározza, hogy a bot automatikusan elforgassa-e a csatorna naplófájljait. A bot elforgatja a naplófájlokat, amikor a naplófájl időbélyegzője megváltozik. Az időbélyegző a 'filenameTimestamp' konfigurációs változó szerint van beállítva."
-
-#: config.py:67
-msgid ""
-"Determines how to represent the timestamp\n"
-" used for the filename in rotated logs. When this timestamp changes, the\n"
-" old logfiles will be closed and a new one started. The format characters\n"
-" for the timestamp are in the time.strftime docs at python.org. In order\n"
-" for your logs to be rotated, you'll also have to enable\n"
-" supybot.plugins.ChannelLogger.rotateLogs."
-msgstr "Meghatározza, hogyan legyen az elforgatott naplófájlok fájlnevéhez használt időbélyegző ábrázolva. Amikor ez az időbélyegző megváltozik, a régi naplófájlok le lesznek zárva és újak lesznek nyitva. A formázási karakterek az időbélyegzőhez a time.strftime-ban vannak a python.org dokumentációiban. Ahhoz, hogy a naplófájljaid el legyenek forgatva, engedélyezned kell a supybot.plugins.ChannelLogger.rotateLogs-t is."
-
-#: config.py:75
-msgid ""
-"Determines whether the bot will partition its\n"
-" channel logs into separate directories based on different criteria."
-msgstr "Meghatározza, hogy a bot szétválassza-e a csatorna naplóit különálló könyvtárakba különböző kritériumok alapján."
-
-#: config.py:78
-msgid ""
-"Determines whether the bot will use a network\n"
-" directory if using directories."
-msgstr "Meghatározza, hogy a bot használjon-e egy könyvtárat a hálózatnak, ha használ könyvtárakat."
-
-#: config.py:81
-msgid ""
-"Determines whether the bot will use a channel\n"
-" directory if using directories."
-msgstr "Meghatározza, hogy a bot használjon-e egy könyvtárat a csatornának, ha használ könyvtárakat."
-
-#: config.py:84
-msgid ""
-"Determines whether the bot will use a timestamp\n"
-" (determined by supybot.plugins.ChannelLogger.directories.timestamp.format)\n"
-" if using directories."
-msgstr "Meghatározza, hogy a bot használjon-e egy időbályegzőt (a supybot.plugins.ChannelLogger.directories.timestamp.format által meghatározott) ha használ könyvtárakat."
-
-#: config.py:88
-msgid ""
-"Determines what timestamp format will be used in\n"
-" the directory structure for channel logs if\n"
-" supybot.plugins.ChannelLogger.directories.timestamp is True."
-msgstr "Meghatározza, milyen időbélyegző formátum lesz használva a könyvtárstruktúrában a csatorna naplófájlokhoz, ha a supybot.plugins.ChannelLogger.directories.timestamp True."
-
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR ORGANIZATION
+# FIRST AUTHOR , YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Limnoria ChannelLogger\n"
+"POT-Creation-Date: 2011-08-10 11:27+CEST\n"
+"PO-Revision-Date: 2011-08-19 16:21+0200\n"
+"Last-Translator: nyuszika7h \n"
+"Language-Team: \n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: pygettext.py 1.5\n"
+
+#: config.py:46
+msgid "Determines whether logging is enabled."
+msgstr "Meghatározza, hogy a naplózás engedélyezve van-e."
+
+#: config.py:48
+msgid ""
+"Determines whether channel logfiles will be\n"
+" flushed anytime they're written to, rather than being buffered by the\n"
+" operating system."
+msgstr "Meghatározza, hogy a csatorna naplófájlok mentve legyenek-e, amikor írva vannak, ahelyett, hogy az operációs rendszer pufferelje őket."
+
+#: config.py:52
+msgid ""
+"Determines whether formatting characters (such\n"
+" as bolding, color, etc.) are removed when writing the logs to disk."
+msgstr "Meghatározza, hogy milyen formázási karakterek (olyan, mint félkövér, szín stb.) vannak eltávolítva a naplófájlok lemezre írásakor."
+
+#: config.py:55
+msgid ""
+"Determines whether the logs for this channel are\n"
+" timestamped with the timestamp in supybot.log.timestampFormat."
+msgstr "Meghatározza, hogy a csatorna naplójai el legyenek-e látva a supybot.log.timestampFormat-ban lévő időbélyegzővel."
+
+#: config.py:58
+msgid ""
+"Determines what string a message should be\n"
+" prefixed with in order not to be logged. If you don't want any such\n"
+" prefix, just set it to the empty string."
+msgstr "Meghatározza, hogy milyen karakterlánccal kell kezdődnie egy üzenetnek, hogy ne legyen naplózva. Ha nem szeretnél semmi ilyen előtagot, csak állítsd üres karakterláncra."
+
+#: config.py:62
+msgid ""
+"Determines whether the bot will automatically\n"
+" rotate the logs for this channel. The bot will rotate logs when the\n"
+" timestamp for the log changes. The timestamp is set according to\n"
+" the 'filenameTimestamp' configuration variable."
+msgstr "Meghatározza, hogy a bot automatikusan elforgassa-e a csatorna naplófájljait. A bot elforgatja a naplófájlokat, amikor a naplófájl időbélyegzője megváltozik. Az időbélyegző a 'filenameTimestamp' konfigurációs változó szerint van beállítva."
+
+#: config.py:67
+msgid ""
+"Determines how to represent the timestamp\n"
+" used for the filename in rotated logs. When this timestamp changes, the\n"
+" old logfiles will be closed and a new one started. The format characters\n"
+" for the timestamp are in the time.strftime docs at python.org. In order\n"
+" for your logs to be rotated, you'll also have to enable\n"
+" supybot.plugins.ChannelLogger.rotateLogs."
+msgstr "Meghatározza, hogyan legyen az elforgatott naplófájlok fájlnevéhez használt időbélyegző ábrázolva. Amikor ez az időbélyegző megváltozik, a régi naplófájlok le lesznek zárva és újak lesznek nyitva. A formázási karakterek az időbélyegzőhez a time.strftime-ban vannak a python.org dokumentációiban. Ahhoz, hogy a naplófájljaid el legyenek forgatva, engedélyezned kell a supybot.plugins.ChannelLogger.rotateLogs-t is."
+
+#: config.py:75
+msgid ""
+"Determines whether the bot will partition its\n"
+" channel logs into separate directories based on different criteria."
+msgstr "Meghatározza, hogy a bot szétválassza-e a csatorna naplóit különálló könyvtárakba különböző kritériumok alapján."
+
+#: config.py:78
+msgid ""
+"Determines whether the bot will use a network\n"
+" directory if using directories."
+msgstr "Meghatározza, hogy a bot használjon-e egy könyvtárat a hálózatnak, ha használ könyvtárakat."
+
+#: config.py:81
+msgid ""
+"Determines whether the bot will use a channel\n"
+" directory if using directories."
+msgstr "Meghatározza, hogy a bot használjon-e egy könyvtárat a csatornának, ha használ könyvtárakat."
+
+#: config.py:84
+msgid ""
+"Determines whether the bot will use a timestamp\n"
+" (determined by supybot.plugins.ChannelLogger.directories.timestamp.format)\n"
+" if using directories."
+msgstr "Meghatározza, hogy a bot használjon-e egy időbályegzőt (a supybot.plugins.ChannelLogger.directories.timestamp.format által meghatározott) ha használ könyvtárakat."
+
+#: config.py:88
+msgid ""
+"Determines what timestamp format will be used in\n"
+" the directory structure for channel logs if\n"
+" supybot.plugins.ChannelLogger.directories.timestamp is True."
+msgstr "Meghatározza, milyen időbélyegző formátum lesz használva a könyvtárstruktúrában a csatorna naplófájlokhoz, ha a supybot.plugins.ChannelLogger.directories.timestamp True."
+
diff --git a/locales/it.po b/locales/it.po
index 05f0787..715d9ca 100644
--- a/locales/it.po
+++ b/locales/it.po
@@ -1,114 +1,114 @@
-msgid ""
-msgstr ""
-"Project-Id-Version: Limnoria\n"
-"POT-Creation-Date: 2011-02-26 09:49+CET\n"
-"PO-Revision-Date: 2011-06-19 16:57+0200\n"
-"Last-Translator: skizzhg \n"
-"Language-Team: Italian \n"
-"Language: it\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#: config.py:46
-msgid "Determines whether logging is enabled."
-msgstr "Determina se i log sono abilitati."
-
-#: config.py:48
-msgid ""
-"Determines whether channel logfiles will be\n"
-" flushed anytime they're written to, rather than being buffered by the\n"
-" operating system."
-msgstr ""
-"Determina se i file di log del canale verranno salvati ogni volta che sono\n"
-" scritti piuttosto che tenuti in memoria dal sistema."
-
-#: config.py:52
-msgid ""
-"Determines whether formatting characters (such\n"
-" as bolding, color, etc.) are removed when writing the logs to disk."
-msgstr ""
-"Determina se la formattazione dei caratteri (come grassetto, colori, ecc.)\n"
-" viene rimossa una volta che i log sono scritti sul disco."
-
-#: config.py:55
-msgid ""
-"Determines whether the logs for this channel are\n"
-" timestamped with the timestamp in supybot.log.timestampFormat."
-msgstr ""
-"Determina se i log per questo canale riportano data e ora (timestamp)\n"
-" con il formato indicato in supybot.log.timestampFormat."
-
-#: config.py:58
-msgid ""
-"Determines what string a message should be\n"
-" prefixed with in order not to be logged. If you don't want any such\n"
-" prefix, just set it to the empty string."
-msgstr ""
-"Determina con quale stringa debba essere prefissato un messaggio per non\n"
-" essere registrato. Se non si vuole alcun prefisso, impostare una stringa vuota.\n"
-
-#: config.py:62
-msgid ""
-"Determines whether the bot will automatically\n"
-" rotate the logs for this channel. The bot will rotate logs when the\n"
-" timestamp for the log changes. The timestamp is set according to\n"
-" the 'filenameTimestamp' configuration variable."
-msgstr ""
-"Determina se il bot ruoterà automaticamente i log di questo canale.\n"
-" Verranno ruotati quando cambiano data e ora; il timestamp\n"
-" è impostato in base alla variabile \"filenameTimestamp\"."
-
-#: config.py:67
-msgid ""
-"Determines how to represent the timestamp\n"
-" used for the filename in rotated logs. When this timestamp changes, the\n"
-" old logfiles will be closed and a new one started. The format characters\n"
-" for the timestamp are in the time.strftime docs at python.org. In order\n"
-" for your logs to be rotated, you'll also have to enable\n"
-" supybot.plugins.ChannelLogger.rotateLogs."
-msgstr ""
-"Determina come rappresentare il timestamp usato per il nome del file da ruotare.\n"
-" Quando questo cambia, il vecchio file di log verrà chiuso e ne inizierà uno\n"
-" nuovo; il formato è lo stesso di time.strftime (documentazione su python.org).\n"
-" Affinché i log vengano ruotati, è inoltre necessario abilitare supybot.plugins.ChannelLogger.rotateLogs."
-
-#: config.py:75
-msgid ""
-"Determines whether the bot will partition its\n"
-" channel logs into separate directories based on different criteria."
-msgstr ""
-"Determina se il bot suddividerà i log del canale in directory separate in base a criteri differenti.\n"
-
-#: config.py:78
-msgid ""
-"Determines whether the bot will use a network\n"
-" directory if using directories."
-msgstr ""
-"Determina se, in caso si utilizzino directory, il bot userà una directory per network.\n"
-
-#: config.py:81
-msgid ""
-"Determines whether the bot will use a channel\n"
-" directory if using directories."
-msgstr ""
-"Determina se, in caso si utilizzino directory, il bot userà una directory per canale.\n"
-
-#: config.py:84
-msgid ""
-"Determines whether the bot will use a timestamp\n"
-" (determined by supybot.plugins.ChannelLogger.directories.timestamp.format)\n"
-" if using directories."
-msgstr ""
-"Determina se, in caso si utilizzino directory, il bot userà un timestamp\n"
-" (definito da supybot.plugins.ChannelLogger.directories.timestamp.format).\n"
-
-#: config.py:88
-msgid ""
-"Determines what timestamp format will be used in\n"
-" the directory structure for channel logs if\n"
-" supybot.plugins.ChannelLogger.directories.timestamp is True."
-msgstr ""
-"Determina quale formato di timestamp sarà utilizzato nella struttura della directory\n"
-" dei log del canale se supybot.plugins.ChannelLogger.directories.timestamp è impostata a True."
-
+msgid ""
+msgstr ""
+"Project-Id-Version: Limnoria\n"
+"POT-Creation-Date: 2011-02-26 09:49+CET\n"
+"PO-Revision-Date: 2011-06-19 16:57+0200\n"
+"Last-Translator: skizzhg \n"
+"Language-Team: Italian \n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: config.py:46
+msgid "Determines whether logging is enabled."
+msgstr "Determina se i log sono abilitati."
+
+#: config.py:48
+msgid ""
+"Determines whether channel logfiles will be\n"
+" flushed anytime they're written to, rather than being buffered by the\n"
+" operating system."
+msgstr ""
+"Determina se i file di log del canale verranno salvati ogni volta che sono\n"
+" scritti piuttosto che tenuti in memoria dal sistema."
+
+#: config.py:52
+msgid ""
+"Determines whether formatting characters (such\n"
+" as bolding, color, etc.) are removed when writing the logs to disk."
+msgstr ""
+"Determina se la formattazione dei caratteri (come grassetto, colori, ecc.)\n"
+" viene rimossa una volta che i log sono scritti sul disco."
+
+#: config.py:55
+msgid ""
+"Determines whether the logs for this channel are\n"
+" timestamped with the timestamp in supybot.log.timestampFormat."
+msgstr ""
+"Determina se i log per questo canale riportano data e ora (timestamp)\n"
+" con il formato indicato in supybot.log.timestampFormat."
+
+#: config.py:58
+msgid ""
+"Determines what string a message should be\n"
+" prefixed with in order not to be logged. If you don't want any such\n"
+" prefix, just set it to the empty string."
+msgstr ""
+"Determina con quale stringa debba essere prefissato un messaggio per non\n"
+" essere registrato. Se non si vuole alcun prefisso, impostare una stringa vuota.\n"
+
+#: config.py:62
+msgid ""
+"Determines whether the bot will automatically\n"
+" rotate the logs for this channel. The bot will rotate logs when the\n"
+" timestamp for the log changes. The timestamp is set according to\n"
+" the 'filenameTimestamp' configuration variable."
+msgstr ""
+"Determina se il bot ruoterà automaticamente i log di questo canale.\n"
+" Verranno ruotati quando cambiano data e ora; il timestamp\n"
+" è impostato in base alla variabile \"filenameTimestamp\"."
+
+#: config.py:67
+msgid ""
+"Determines how to represent the timestamp\n"
+" used for the filename in rotated logs. When this timestamp changes, the\n"
+" old logfiles will be closed and a new one started. The format characters\n"
+" for the timestamp are in the time.strftime docs at python.org. In order\n"
+" for your logs to be rotated, you'll also have to enable\n"
+" supybot.plugins.ChannelLogger.rotateLogs."
+msgstr ""
+"Determina come rappresentare il timestamp usato per il nome del file da ruotare.\n"
+" Quando questo cambia, il vecchio file di log verrà chiuso e ne inizierà uno\n"
+" nuovo; il formato è lo stesso di time.strftime (documentazione su python.org).\n"
+" Affinché i log vengano ruotati, è inoltre necessario abilitare supybot.plugins.ChannelLogger.rotateLogs."
+
+#: config.py:75
+msgid ""
+"Determines whether the bot will partition its\n"
+" channel logs into separate directories based on different criteria."
+msgstr ""
+"Determina se il bot suddividerà i log del canale in directory separate in base a criteri differenti.\n"
+
+#: config.py:78
+msgid ""
+"Determines whether the bot will use a network\n"
+" directory if using directories."
+msgstr ""
+"Determina se, in caso si utilizzino directory, il bot userà una directory per network.\n"
+
+#: config.py:81
+msgid ""
+"Determines whether the bot will use a channel\n"
+" directory if using directories."
+msgstr ""
+"Determina se, in caso si utilizzino directory, il bot userà una directory per canale.\n"
+
+#: config.py:84
+msgid ""
+"Determines whether the bot will use a timestamp\n"
+" (determined by supybot.plugins.ChannelLogger.directories.timestamp.format)\n"
+" if using directories."
+msgstr ""
+"Determina se, in caso si utilizzino directory, il bot userà un timestamp\n"
+" (definito da supybot.plugins.ChannelLogger.directories.timestamp.format).\n"
+
+#: config.py:88
+msgid ""
+"Determines what timestamp format will be used in\n"
+" the directory structure for channel logs if\n"
+" supybot.plugins.ChannelLogger.directories.timestamp is True."
+msgstr ""
+"Determina quale formato di timestamp sarà utilizzato nella struttura della directory\n"
+" dei log del canale se supybot.plugins.ChannelLogger.directories.timestamp è impostata a True."
+
diff --git a/logs_stats.sql b/logs_stats.sql
deleted file mode 100644
index ad142d3..0000000
--- a/logs_stats.sql
+++ /dev/null
@@ -1,198 +0,0 @@
---
--- PostgreSQL database dump
---
-
-SET statement_timeout = 0;
-SET client_encoding = 'UTF8';
-SET standard_conforming_strings = on;
-SET check_function_bodies = false;
-SET client_min_messages = warning;
-SET TIMEZONE TO 'Europe/London';
-
---
--- Name: logs_stats; Type: COMMENT; Schema: -; Owner: postgres
---
-
-COMMENT ON DATABASE logs_stats IS 'default administrative connection database';
-
-
---
--- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
---
-
-CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
-
-
---
--- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
---
-
-COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
-
-
-SET search_path = public, pg_catalog;
-
---
--- Name: action; Type: TYPE; Schema: public; Owner: postgres
---
-
-CREATE TYPE action AS ENUM (
- 'message',
- 'emote',
- 'join',
- 'part',
- 'quit'
-);
-
-
-ALTER TYPE public.action OWNER TO postgres;
-
-SET default_tablespace = '';
-
-SET default_with_oids = false;
-
---
--- Name: messages; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
---
-
-CREATE TABLE messages (
- "user" integer NOT NULL,
- content text,
- action action,
- id integer NOT NULL,
- "timestamp" timestamp with time zone DEFAULT now()
-);
-
-
-ALTER TABLE public.messages OWNER TO postgres;
-
---
--- Name: messages_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
---
-
-CREATE SEQUENCE messages_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
-ALTER TABLE public.messages_id_seq OWNER TO postgres;
-
---
--- Name: messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
---
-
-ALTER SEQUENCE messages_id_seq OWNED BY messages.id;
-
-
---
--- Name: users; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
---
-
-CREATE TABLE users (
- "user" text,
- id integer NOT NULL,
- host character varying,
- in_use boolean DEFAULT true
-);
-
-
-ALTER TABLE public.users OWNER TO postgres;
-
---
--- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
---
-
-CREATE SEQUENCE users_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
-ALTER TABLE public.users_id_seq OWNER TO postgres;
-
---
--- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
---
-
-ALTER SEQUENCE users_id_seq OWNED BY users.id;
-
-
---
--- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
---
-
-ALTER TABLE ONLY messages ALTER COLUMN id SET DEFAULT nextval('messages_id_seq'::regclass);
-
-
---
--- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
---
-
-ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);
-
-
---
--- Data for Name: messages; Type: TABLE DATA; Schema: public; Owner: postgres
---
-
-COPY messages ("user", content, action, id, "timestamp") FROM stdin;
-\.
-
-
---
--- Name: messages_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
---
-
-SELECT pg_catalog.setval('messages_id_seq', 1, false);
-
-
---
--- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: postgres
---
-
-COPY users ("user", id, host, in_use) FROM stdin;
-\.
-
-
---
--- Name: users_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
---
-
-SELECT pg_catalog.setval('users_id_seq', 1, false);
-
-
---
--- Name: messages_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
---
-
-ALTER TABLE ONLY messages
- ADD CONSTRAINT messages_pkey PRIMARY KEY (id);
-
-
---
--- Name: users_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
---
-
-ALTER TABLE ONLY users
- ADD CONSTRAINT users_id_key UNIQUE (id);
-
-
---
--- Name: public; Type: ACL; Schema: -; Owner: postgres
---
-
-REVOKE ALL ON SCHEMA public FROM PUBLIC;
-REVOKE ALL ON SCHEMA public FROM postgres;
-GRANT ALL ON SCHEMA public TO postgres;
-GRANT ALL ON SCHEMA public TO PUBLIC;
-
-
---
--- PostgreSQL database dump complete
---
-
diff --git a/messages.pot b/messages.pot
index c1d2770..750c7d2 100644
--- a/messages.pot
+++ b/messages.pot
@@ -1,101 +1,101 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR ORGANIZATION
-# FIRST AUTHOR , YEAR.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2012-10-07 18:37+EEST\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: LANGUAGE \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: ENCODING\n"
-"Generated-By: pygettext.py 1.5\n"
-
-
-#: config.py:46
-msgid "Determines whether logging is enabled."
-msgstr ""
-
-#: config.py:48
-msgid ""
-"Determines whether channel logfiles will be\n"
-" flushed anytime they're written to, rather than being buffered by the\n"
-" operating system."
-msgstr ""
-
-#: config.py:52
-msgid "Determines wether joins and parts are logged"
-msgstr ""
-
-#: config.py:54
-msgid ""
-"Determines whether formatting characters (such\n"
-" as bolding, color, etc.) are removed when writing the logs to disk."
-msgstr ""
-
-#: config.py:57
-msgid ""
-"Determines whether the logs for this channel are\n"
-" timestamped with the timestamp in supybot.log.timestampFormat."
-msgstr ""
-
-#: config.py:60
-msgid ""
-"Determines what string a message should be\n"
-" prefixed with in order not to be logged. If you don't want any such\n"
-" prefix, just set it to the empty string."
-msgstr ""
-
-#: config.py:64
-msgid ""
-"Determines whether the bot will automatically\n"
-" rotate the logs for this channel. The bot will rotate logs when the\n"
-" timestamp for the log changes. The timestamp is set according to\n"
-" the 'filenameTimestamp' configuration variable."
-msgstr ""
-
-#: config.py:69
-msgid ""
-"Determines how to represent the timestamp\n"
-" used for the filename in rotated logs. When this timestamp changes, the\n"
-" old logfiles will be closed and a new one started. The format characters\n"
-" for the timestamp are in the time.strftime docs at python.org. In order\n"
-" for your logs to be rotated, you'll also have to enable\n"
-" supybot.plugins.ChannelLogger.rotateLogs."
-msgstr ""
-
-#: config.py:77
-msgid ""
-"Determines whether the bot will partition its\n"
-" channel logs into separate directories based on different criteria."
-msgstr ""
-
-#: config.py:80
-msgid ""
-"Determines whether the bot will use a network\n"
-" directory if using directories."
-msgstr ""
-
-#: config.py:83
-msgid ""
-"Determines whether the bot will use a channel\n"
-" directory if using directories."
-msgstr ""
-
-#: config.py:86
-msgid ""
-"Determines whether the bot will use a timestamp\n"
-" (determined by supybot.plugins.ChannelLogger.directories.timestamp.format)\n"
-" if using directories."
-msgstr ""
-
-#: config.py:90
-msgid ""
-"Determines what timestamp format will be used in\n"
-" the directory structure for channel logs if\n"
-" supybot.plugins.ChannelLogger.directories.timestamp is True."
-msgstr ""
-
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR ORGANIZATION
+# FIRST AUTHOR , YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2012-10-07 18:37+EEST\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: ENCODING\n"
+"Generated-By: pygettext.py 1.5\n"
+
+
+#: config.py:46
+msgid "Determines whether logging is enabled."
+msgstr ""
+
+#: config.py:48
+msgid ""
+"Determines whether channel logfiles will be\n"
+" flushed anytime they're written to, rather than being buffered by the\n"
+" operating system."
+msgstr ""
+
+#: config.py:52
+msgid "Determines wether joins and parts are logged"
+msgstr ""
+
+#: config.py:54
+msgid ""
+"Determines whether formatting characters (such\n"
+" as bolding, color, etc.) are removed when writing the logs to disk."
+msgstr ""
+
+#: config.py:57
+msgid ""
+"Determines whether the logs for this channel are\n"
+" timestamped with the timestamp in supybot.log.timestampFormat."
+msgstr ""
+
+#: config.py:60
+msgid ""
+"Determines what string a message should be\n"
+" prefixed with in order not to be logged. If you don't want any such\n"
+" prefix, just set it to the empty string."
+msgstr ""
+
+#: config.py:64
+msgid ""
+"Determines whether the bot will automatically\n"
+" rotate the logs for this channel. The bot will rotate logs when the\n"
+" timestamp for the log changes. The timestamp is set according to\n"
+" the 'filenameTimestamp' configuration variable."
+msgstr ""
+
+#: config.py:69
+msgid ""
+"Determines how to represent the timestamp\n"
+" used for the filename in rotated logs. When this timestamp changes, the\n"
+" old logfiles will be closed and a new one started. The format characters\n"
+" for the timestamp are in the time.strftime docs at python.org. In order\n"
+" for your logs to be rotated, you'll also have to enable\n"
+" supybot.plugins.ChannelLogger.rotateLogs."
+msgstr ""
+
+#: config.py:77
+msgid ""
+"Determines whether the bot will partition its\n"
+" channel logs into separate directories based on different criteria."
+msgstr ""
+
+#: config.py:80
+msgid ""
+"Determines whether the bot will use a network\n"
+" directory if using directories."
+msgstr ""
+
+#: config.py:83
+msgid ""
+"Determines whether the bot will use a channel\n"
+" directory if using directories."
+msgstr ""
+
+#: config.py:86
+msgid ""
+"Determines whether the bot will use a timestamp\n"
+" (determined by supybot.plugins.ChannelLogger.directories.timestamp.format)\n"
+" if using directories."
+msgstr ""
+
+#: config.py:90
+msgid ""
+"Determines what timestamp format will be used in\n"
+" the directory structure for channel logs if\n"
+" supybot.plugins.ChannelLogger.directories.timestamp is True."
+msgstr ""
+
diff --git a/plugin.py b/plugin.py
index f4898ed..70acd8e 100644
--- a/plugin.py
+++ b/plugin.py
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
###
# Copyright (c) 2002-2004, Jeremiah Fincher
# Copyright (c) 2009-2010, James McCoy
@@ -30,21 +31,26 @@
import os
import time
+import re
import sys
-from cStringIO import StringIO
-sys.path.append(os.getcwd() + '/plugins/ChannelLogger')
-import channelLogger_model as channellogger_model
+import chardet
+from io import StringIO
+sys.path.append(os.getcwd() + '/plugins/LogsToDB')
+from . import channelLogger_model as channellogger_model
+
+from supybot.commands import *
import supybot.conf as conf
import supybot.world as world
import supybot.ircdb as ircdb
import supybot.irclib as irclib
import supybot.ircmsgs as ircmsgs
import supybot.ircutils as ircutils
+import supybot.schedule as schedule
import supybot.registry as registry
import supybot.callbacks as callbacks
from supybot.i18n import PluginInternationalization, internationalizeDocstring
-_ = PluginInternationalization('ChannelLogger')
+_ = PluginInternationalization('LogsToDB')
class FakeLog(object):
def flush(self):
@@ -54,10 +60,10 @@ def close(self):
def write(self, s):
return
-class ChannelLogger(callbacks.Plugin):
+class LogsToDB(callbacks.Plugin):
noIgnore = True
def __init__(self, irc):
- self.__parent = super(ChannelLogger, self)
+ self.__parent = super(LogsToDB, self)
self.__parent.__init__(irc)
self.lastMsgs = {}
self.lastStates = {}
@@ -66,6 +72,44 @@ def __init__(self, irc):
world.flushers.append(self.flusher)
self.logViewerDB = channellogger_model.LogviewerDB()
self.logViewerFile = channellogger_model.LogviewerFile()
+ self.currentUsers = 0
+ def myEventCaller():
+ self.addCount(irc)
+ schedule.addPeriodicEvent(myEventCaller, 600, 'mySpamEvent')
+
+
+ def addCount(self, irc):
+ "Periodically check the amount of users in the channel every 10 minutes"
+ for chan in list(irc.state.channels.keys()):
+ self.logViewerDB.add_count(len(irc.state.channels[chan].users), chan, irc.state.channels[chan].topic)
+
+
+ def to_unicode_or_bust(self, obj, encoding='utf-8'):
+ if isinstance(obj, str):
+ if not isinstance(obj, str):
+ obj = str(obj, encoding)
+
+ return obj
+
+ def decode(self, bytes):
+ try:
+ text = bytes.decode('utf-8')
+ except UnicodeDecodeError:
+ try:
+ text = bytes.decode('iso-8859-1')
+ except UnicodeDecodeError:
+ text = bytes.decode('cp1252')
+ return text
+
+ def encode(self, bytes):
+ try:
+ text = bytes.encode('utf-8')
+ except UnicodeEncodeError:
+ try:
+ text = bytes.encode('iso-8859-1')
+ except UnicodeEncodeError:
+ text = bytes.encode('cp1252')
+ return text
def die(self):
for log in self._logs():
@@ -94,8 +138,8 @@ def reset(self):
self.lastStates.clear()
def _logs(self):
- for logs in self.logs.itervalues():
- for log in logs.itervalues():
+ for logs in self.logs.values():
+ for log in logs.values():
yield log
def flush(self):
@@ -103,7 +147,7 @@ def flush(self):
for log in self._logs():
try:
log.flush()
- except ValueError, e:
+ except ValueError as e:
if e.args[0] != 'I/O operation on a closed file':
self.log.exception('Odd exception:')
@@ -133,8 +177,8 @@ def getLogDir(self, irc, channel):
return logDir
def checkLogNames(self):
- for (irc, logs) in self.logs.items():
- for (channel, log) in logs.items():
+ for (irc, logs) in list(self.logs.items()):
+ for (channel, log) in list(logs.items()):
if self.registryValue('rotateLogs', channel):
name = self.getLogName(channel)
if name != log.name:
@@ -196,7 +240,7 @@ def doPrivmsg(self, irc, msg):
except KeyError:
logChannelMessages = True
nick = msg.nick or irc.nick
- if msg.tagged('ChannelLogger__relayed'):
+ if msg.tagged('LogsToDB__relayed'):
(nick, text) = text.split(' ', 1)
nick = nick[1:-1]
msg.args = (recipients, text)
@@ -208,9 +252,10 @@ def doPrivmsg(self, irc, msg):
'* %s %s\n', nick, ircmsgs.unAction(msg))
else:
self.doLog(irc, channel, '<%s> %s\n', nick, text)
-
- self.logViewerDB.add_message(msg.nick, msg.prefix, msg.args[1])
- self.logViewerFile.write_message(msg.nick, msg.args[1])
+
+ message = msg.args[1]
+ self.logViewerDB.add_message(msg.nick, msg.prefix, message, channel)
+ self.logViewerFile.write_message(msg.nick, message)
def doNotice(self, irc, msg):
(recipients, text) = msg.args
@@ -218,10 +263,22 @@ def doNotice(self, irc, msg):
if irc.isChannel(channel):
self.doLog(irc, channel, '-%s- %s\n', msg.nick, text)
+
+ def getcount(self, irc, msg, args):
+ """
+
+ Returns a random quote from . is only necessary if
+ the message isn't sent in the channel itself.
+ """
+ # irc.reply(str(len(irc.state.channels["#web"].users)))
+ print(irc.state.channels["#web"].topic)
+
+ getcount = wrap(getcount)
+
def doNick(self, irc, msg):
oldNick = msg.nick
newNick = msg.args[0]
- for (channel, c) in irc.state.channels.iteritems():
+ for (channel, c) in irc.state.channels.items():
if newNick in c.users:
self.doLog(irc, channel,
'*** %s is now known as %s\n', oldNick, newNick)
@@ -231,7 +288,6 @@ def doJoin(self, irc, msg):
self.doLog(irc, channel,
'*** %s <%s> has joined %s\n',
msg.nick, msg.prefix, channel)
- self.logViewerDB.add_join(msg.nick, msg.prefix)
self.logViewerFile.write_join(msg.nick, msg.prefix, channel)
def doKick(self, irc, msg):
@@ -240,13 +296,17 @@ def doKick(self, irc, msg):
else:
(channel, target) = msg.args
kickmsg = ''
+
+ print(msg)
if kickmsg:
self.doLog(irc, channel,
'*** %s was kicked by %s (%s)\n',
target, msg.nick, kickmsg)
+ self.logViewerFile.write_kick(target, msg.nick, channel)
else:
self.doLog(irc, channel,
- '*** %s was kicked by %s\n', target, msg.nick)
+ '*** %s was kicked by %s\n', target, msg.nick, channel)
+ self.logViewerFile.write_kick(target, msg.nick)
def doPart(self, irc, msg):
if len(msg.args) > 1:
@@ -258,7 +318,7 @@ def doPart(self, irc, msg):
self.doLog(irc, channel,
'*** %s <%s> has left %s%s\n',
msg.nick, msg.prefix, channel, reason)
- self.logViewerDB.add_part(msg.nick, msg.prefix)
+ self.logViewerDB.add_part(msg.nick, msg.prefix, channel)
self.logViewerFile.write_part(msg.nick, msg.prefix, channel)
def doMode(self, irc, msg):
@@ -268,6 +328,13 @@ def doMode(self, irc, msg):
'*** %s sets mode: %s %s\n',
msg.nick or msg.prefix, msg.args[1],
' '.join(msg.args[2:]))
+ if (msg.args[1] == '+b'):
+ self.logViewerFile.write_ban(msg.nick, msg.prefix, msg.args[1], ' '.join(msg.args[2:]), channel)
+ self.logViewerDB.write_ban(msg.nick, msg.prefix, msg.args[1], ' '.join(msg.args[2:]), channel)
+ elif (msg.args[1] == '-b'):
+ self.logViewerFile.write_unban(msg.nick, msg.prefix, msg.args[1], ' '.join(msg.args[2:]), channel)
+ self.logViewerDB.write_unban(msg.nick, msg.prefix, msg.args[1], ' '.join(msg.args[2:]), channel)
+
def doTopic(self, irc, msg):
if len(msg.args) == 1:
@@ -283,13 +350,13 @@ def doQuit(self, irc, msg):
reason = ""
if not isinstance(irc, irclib.Irc):
irc = irc.getRealIrc()
- for (channel, chan) in self.lastStates[irc].channels.iteritems():
+ for (channel, chan) in self.lastStates[irc].channels.items():
if(self.registryValue('showJoinParts', channel)):
if msg.nick in chan.users:
self.doLog(irc, channel,
'*** %s <%s> has quit IRC%s\n',
msg.nick, msg.prefix, reason)
- self.logViewerDB.add_quit(msg.nick, msg.prefix)
+ self.logViewerDB.add_quit(msg.nick, msg.prefix, channel)
self.logViewerFile.write_quit(msg.nick, msg.prefix, channel)
def outFilter(self, irc, msg):
@@ -304,5 +371,5 @@ def outFilter(self, irc, msg):
return msg
-Class = ChannelLogger
+Class = LogsToDB
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
diff --git a/setup.py b/setup.py
index 333a348..abad6ca 100644
--- a/setup.py
+++ b/setup.py
@@ -1,48 +1,15 @@
-#!/usr/bin/python
-import subprocess
-import os
-import getpass
-import sys
-import json
-# Postgresql needs to be install
-# libpq-dev and python-dev needs to be installed for psycopg2
-if not os.path.exists('config.json'):
- print "First a config file needs to be created......"
- userName = raw_input('Please enter your user name (pref your OS username): ')
- userPass = getpass.getpass('Please enter your password for the Postgresql database (won\'t echo)');
- with open('config.json', 'w') as configFile:
- configText = """
-{
- "db": {
- "host": "127.0.0.1",
- "dbname": "logs_stats",
- "user": "%s",
- "password": "%s"
- }
-}
- """ % (userName, userPass, userName)
- configFile.write(configText)
- confirm = raw_input("Are you running this script from the host machine? yes/no: ")
- if (confirm == "yes"):
- print "Run again from guest"
- sys.exit();
-
-# open the config file
-with open('config.json', 'r') as configFile:
- data = json.loads(configFile.read());
-
-userName = data['db']['user']
-userPass = data['db']['password']
-
-subprocess.call(['apt-get', 'install', '-y', 'postgresql', 'libpq-dev', 'python-dev', 'python-pip'])
-subprocess.call(['pip', 'install', 'psycopg2'])
-
-os.system('echo "CREATE ROLE %s LOGIN ENCRYPTED PASSWORD \'%s\';" | sudo -u postgres psql' % (userName, userPass))
-os.system('echo "CREATE DATABASE logs_stats OWNER %s;" | sudo -u postgres psql' % userName)
-os.system('sudo -u postgres psql logs_stats < logs_stats.sql')
-
-os.system('echo "ALTER TABLE messages OWNER TO %s;" | sudo -u postgres psql logs_stats' % userName)
-os.system('echo "ALTER TABLE messages_id_seq OWNER TO %s;" | sudo -u postgres psql logs_stats' % userName)
-os.system('echo "ALTER TYPE action OWNER TO %s;" | sudo -u postgres psql logs_stats' % userName)
-os.system('echo "ALTER TABLE users OWNER TO %s;" | sudo -u postgres psql logs_stats' % userName)
-os.system('echo "ALTER TABLE users_id_seq OWNER TO %s;" | sudo -u postgres psql logs_stats' % userName)
\ No newline at end of file
+#!/usr/bin/python
+import subprocess
+import os
+import getpass
+import sys
+import json
+# Get Limnoria & install it
+# you will need to install hashweb.org before running this
+os.chdir('../');
+if not os.path.exists('Limnoria'):
+ print('Grabbing dependancy Limnoria...')
+ subprocess.call(['git', 'clone', 'git://github.com/ProgVal/Limnoria.git']);
+os.chdir('Limnoria');
+subprocess.call(['pip3', 'install', '-r', 'requirements.txt'])
+subprocess.call(['python3', 'setup.py', 'install'])
\ No newline at end of file
diff --git a/test.py b/test.py
deleted file mode 100644
index eb40645..0000000
--- a/test.py
+++ /dev/null
@@ -1,36 +0,0 @@
-###
-# Copyright (c) 2005, Jeremiah Fincher
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# * Redistributions of source code must retain the above copyright notice,
-# this list of conditions, and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions, and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# * Neither the name of the author of this software nor the name of
-# contributors to this software may be used to endorse or promote products
-# derived from this software without specific prior written consent.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-###
-
-from supybot.test import *
-
-class ChannelLoggerTestCase(PluginTestCase):
- plugins = ('ChannelLogger',)
-
-
-# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: