From 3a82d3281bd33c853065ff13a91ea3b8ef29c0f6 Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Mon, 4 Jun 2012 21:39:23 -0700 Subject: [PATCH] handle GrumbleErrors in a nicer way --- bot.py | 3 +++ phenny | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index e06e775..e1408a8 100755 --- a/bot.py +++ b/bot.py @@ -9,6 +9,7 @@ http://inamidst.com/phenny/ import sys, os, re, threading, imp import irc +import tools home = os.getcwd() @@ -194,6 +195,8 @@ class Phenny(irc.Bot): def call(self, func, origin, phenny, input): try: func(phenny, input) + except tools.GrumbleError as e: + self.msg(origin.sender, str(e)) except Exception as e: self.error(origin) diff --git a/phenny b/phenny index b1e885a..7accb33 100755 --- a/phenny +++ b/phenny @@ -126,7 +126,6 @@ def main(argv=None): parser.add_argument('-c', '--config', metavar='fn', help='use this configuration file or directory') args = parser.parse_args(argv) - #if args: print('Warning: ignoring spurious arguments', file=sys.stderr) # Step Two: Check Dependencies