diff options
author | kongr45gpen <electrovesta@gmail.com> | 2014-04-28 00:16:14 +0300 |
---|---|---|
committer | kongr45gpen <electrovesta@gmail.com> | 2014-04-28 00:16:14 +0300 |
commit | b4c587246e389b72019f76515dc04e0e13b92eb6 (patch) | |
tree | 62d777f222b7925b66ec10635385b92560973f5e /plugin.py | |
parent | 8afc8e3105c89115c4327f83041bb96796c894ef (diff) | |
download | supybot_github-b4c587246e389b72019f76515dc04e0e13b92eb6.tar.gz supybot_github-b4c587246e389b72019f76515dc04e0e13b92eb6.tar.bz2 supybot_github-b4c587246e389b72019f76515dc04e0e13b92eb6.zip |
Add tests
Diffstat (limited to 'plugin.py')
-rw-r--r-- | plugin.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 |