From 02cd153e3d4ae215a5d8b4be3bfcf06614a560ef Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sun, 22 Aug 2004 15:04:11 +0000 Subject: [PATCH] Blech. I should reverse the arguments of makeChannelFilename officially, because I keep messing them up. --- plugins/Quotes.py | 2 +- plugins/__init__.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/Quotes.py b/plugins/Quotes.py index 4d1ef41d2..22bb8d75b 100644 --- a/plugins/Quotes.py +++ b/plugins/Quotes.py @@ -82,7 +82,7 @@ class QuoteRecord(object): class SqliteQuotesDB(object): def _getDb(self, channel): - filename = plugins.makeChannelFilename('Quotes.db', channel) + filename = plugins.makeChannelFilename(channel, 'Quotes.db') if os.path.exists(filename): return sqlite.connect(db=filename, mode=0755, converters={'bool': bool}) diff --git a/plugins/__init__.py b/plugins/__init__.py index d1e63c105..f7466afb8 100644 --- a/plugins/__init__.py +++ b/plugins/__init__.py @@ -111,6 +111,8 @@ class DBHandler(object): def makeChannelFilename(channel, filename, dirname=None): + assert ircutils.isChannel(channel), 'channel not a channel, ' \ + 'the arguments to makeChannelFilename are probably reversed.' assert filename == os.path.basename(filename), 'We don\'t handle dirs.' channel = ircutils.toLower(channel) if conf.supybot.databases.plugins.channelSpecific.get(channel)():