diff --git a/Bantracker/plugin.py b/Bantracker/plugin.py index 205ca63..ea659e2 100644 --- a/Bantracker/plugin.py +++ b/Bantracker/plugin.py @@ -221,14 +221,23 @@ class Bantracker(callbacks.Plugin): def die(self): global queue if self.db: - self.db.close() - self.thread_timer.cancel() + try: + self.db.close() + except: + pass + try: + self.thread_timer.cancel() + except: + pass queue.clear() def reset(self): global queue if self.db: - self.db.close() + try: + self.db.close() + except: + pass queue.clear() self.logs.clear() self.lastMsgs.clear() diff --git a/Encyclopedia/README.txt b/Encyclopedia/README.txt index 3a9d4f5..fa541c7 100644 --- a/Encyclopedia/README.txt +++ b/Encyclopedia/README.txt @@ -9,8 +9,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -This plugin is a rather intricate combination of a factoid plugin and package -info lookup via apt. Here's how to set it up: +This plugin is a factoid plugin. Here's how to set it up: Pick a name for your database. A lowercase-only name without spaces is probably best, this example wil use myfactoids as name. Then create a directory to store @@ -53,19 +52,5 @@ commoncgi.py file from the bzr tree. Make sure you set the variables datadir and database in factoids.cgi to the correct values. Also set default_db to the one you want to show by default. -To get package lookup working, you need to set the variable -supybot.plugins.encyclopedia.aptdir to the name of a new, empty directory. In -this directory, you create sources.list files for every distrorelease you want to -search. The name of the file is important, since the filename (without the .list -suffix) is the name that is used to refer to the distrorelease. - -Whenever you create a new .list file, it is important to run the update_apt -and update_apt_file scripts that comes with this plugin. Before you run these, -you have to edit them to point to your apt dir. It's also useful to run them -periodically from cron (say, once per week for update_apt and once per moth for -update_apt_file). You also need to reload the plugin to make it pick up the new -releases. - -It is very useful to set the supybot.plugins.encyclopedia.searchorder value to a -space separated list of release names. That way you can limit the (expensive) -searching for packages to a small set of releases. +This plugin used to have package lookup, this was mooved to the PackageInfo +plugin. diff --git a/Encyclopedia/plugin.py b/Encyclopedia/plugin.py index b508c38..2bf8c41 100644 --- a/Encyclopedia/plugin.py +++ b/Encyclopedia/plugin.py @@ -665,8 +665,11 @@ class Encyclopedia(callbacks.Plugin): data = fd2.read(47) if data == '** This file contains an SQLite 2.1 database **': # OK, rename to dpath os.rename(tmp_db, dpath) - self.databases[channel].close() - self.databases.pop(channel) + try: + self.databases[channel].close() + self.databases.pop(channel) + except: + pass else: # Remove the tmpparary file and raise an error os.remove(tmp_db) raise RuntimeError, "Downloaded file was not a SQLite 2.1 database" diff --git a/PackageInfo/README.txt b/PackageInfo/README.txt index d60b47a..2c5e28e 100644 --- a/PackageInfo/README.txt +++ b/PackageInfo/README.txt @@ -1 +1,41 @@ -Insert a description of your plugin here, with any notes, etc. about using it. +This plugin allows package lookup via apt-cache/apt-file + +--Setup-- +supybot.plugins.PackageInfo.aptdir: +Directory to use to store the apt cache (Global) +Default: '' + +Create a new empty directory that will be used for the apt cache. +In this directory, you create sources.list files for every release you +want to search. The name of the file is important, since the filename (without +the .list suffix) is the name that is used to refer to the release. + +supybot.plugins.PackageInfo.defaultRelease: +Set this to the default release to use when none is specified. (Channel) +Default: '' + +Whenever you create a new .list file, it is important to run the update_apt +and update_apt_file scripts that comes with this plugin. Before you run these, +you have to edit them to point to your apt dir. It's also useful to run them +periodically from cron (say, once per week for update_apt and once per moth for +update_apt_file). You also need to reload the plugin to make it pick up the new +releases. + +supybot.plugins.PackageInfo.enabled: +Enable or disable package lookup snarfing. (Channel) +Default: True + +supybot.plugins.PackageInfo.prefixchar: +Prefix character for the package lookup snarfer. (Channel) +Default: ! + +--Usage-- +find [] +Search for or, of that fails, find 's package(s). +Optionally in + +info [] +Lookup information for , optionally in + +if supybot.plugins.PackageInfo.enabled is True the bot will also reply to +the commands if prefixed with supybot.plugins.PackageInfo.prefixchar. diff --git a/Webcal/plugin.py b/Webcal/plugin.py index 098c6f2..a5df79f 100644 --- a/Webcal/plugin.py +++ b/Webcal/plugin.py @@ -19,6 +19,7 @@ import supybot.ircutils as ircutils import supybot.callbacks as callbacks import supybot.schedule as schedule import supybot.ircmsgs as ircmsgs +import supybot.conf as conf import pytz import ical import datetime, shelve, re