diff --git a/.travis.yml b/.travis.yml index b27a7059e..c3f60dabc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ python: - "pypy" # command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors install: - - pip install pytz feedparser charade sqlalchemy python-gnupg --use-mirrors + - pip install pytz feedparser charade sqlalchemy python-gnupg python-dateutil --use-mirrors # command to run tests, e.g. python setup.py test script: - echo $TRAVIS_PYTHON_VERSION diff --git a/plugins/ChannelStats/plugin.py b/plugins/ChannelStats/plugin.py index 9e353a671..1ea05eacd 100644 --- a/plugins/ChannelStats/plugin.py +++ b/plugins/ChannelStats/plugin.py @@ -358,9 +358,11 @@ class ChannelStats(callbacks.Plugin): Returns the statistics for . is only necessary if the message isn't sent on the channel itself. """ - if msg.nick not in irc.state.channels[channel].users: - irc.error(format('You must be in %s to use this command.', channel)) - return + if channel not in irc.state.channels: + irc.error(_('I am not in %s.', channel), Raise=True) + elif msg.nick not in irc.state.channels[channel].users: + irc.error(_('You must be in %s to use this command.') % channel, + Raise=True) try: channeldb = conf.supybot.databases.plugins.channelSpecific. \ getChannelLink(channel) diff --git a/plugins/PluginDownloader/plugin.py b/plugins/PluginDownloader/plugin.py index cec393ebb..0d63ec296 100644 --- a/plugins/PluginDownloader/plugin.py +++ b/plugins/PluginDownloader/plugin.py @@ -254,6 +254,10 @@ repositories = { 'Jonimoose', 'Supybot-plugins', ), + 'skgsergio': GithubRepository( + 'skgsergio', + 'Limnoria-plugins', + ), } class PluginDownloader(callbacks.Plugin): diff --git a/plugins/Time/plugin.py b/plugins/Time/plugin.py index c796ecb4d..0053971b4 100644 --- a/plugins/Time/plugin.py +++ b/plugins/Time/plugin.py @@ -31,8 +31,6 @@ import time TIME = time # For later use. from datetime import datetime -from dateutil import parser - import supybot.conf as conf import supybot.utils as utils from supybot.commands import * @@ -40,20 +38,25 @@ import supybot.callbacks as callbacks from supybot.i18n import PluginInternationalization, internationalizeDocstring _ = PluginInternationalization('Time') -def parse(s): - todo = [] - s = s.replace('noon', '12:00') - s = s.replace('midnight', '00:00') - if 'tomorrow' in s: - todo.append(lambda i: i + 86400) - s = s.replace('tomorrow', '') - if 'next week' in s: - todo.append(lambda i: i + 86400*7) - s = s.replace('next week', '') - i = int(time.mktime(parser.parse(s, fuzzy=True).timetuple())) - for f in todo: - i = f(i) - return i + +try: + from dateutil import parser + def parse(s): + todo = [] + s = s.replace('noon', '12:00') + s = s.replace('midnight', '00:00') + if 'tomorrow' in s: + todo.append(lambda i: i + 86400) + s = s.replace('tomorrow', '') + if 'next week' in s: + todo.append(lambda i: i + 86400*7) + s = s.replace('next week', '') + i = int(time.mktime(parser.parse(s, fuzzy=True).timetuple())) + for f in todo: + i = f(i) + return i +except ImportError: + parse = None class Time(callbacks.Plugin): @internationalizeDocstring @@ -99,6 +102,9 @@ class Time(callbacks.Plugin):