From b4c587246e389b72019f76515dc04e0e13b92eb6 Mon Sep 17 00:00:00 2001 From: kongr45gpen Date: Mon, 28 Apr 2014 00:16:14 +0300 Subject: Add tests --- plugin.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'plugin.py') diff --git a/plugin.py b/plugin.py index 6985213..5052c06 100644 --- a/plugin.py +++ b/plugin.py @@ -52,6 +52,8 @@ import local.globals as globals import local.handler.GithubHandler as RequestHandler import local.utility as Utility +globals.init() + class Github(callbacks.Plugin): """Add the help for \"@plugin help Github\" here This should describe how to use this plugin.""" @@ -109,8 +111,10 @@ class Github(callbacks.Plugin): if order == 'last' or type == 'last': requestedNum = len(globals.messageList) - requestedNum + 1 - print globals.messageList - irc.reply(globals.messageList[requestedNum-1]) + try: + irc.reply(globals.messageList[requestedNum-1]) + except IndexError: + irc.error('No such message') # Debug function get = wrap(get, ['lowered', optional('lowered'), optional('text')]) if world.testing else False -- cgit v1.2.3