Make sure to catch amazon.NoLicenseKey and provide a nice "hold-my-hand" help

message.
This commit is contained in:
James Vega 2004-02-12 01:13:16 +00:00
parent f364bb9705
commit 09eae1bdcc
1 changed files with 10 additions and 0 deletions

View File

@ -80,6 +80,16 @@ conf.registerGlobalValue(conf.supybot.plugins.Amazon, 'licenseKey',
class Amazon(callbacks.Privmsg):
threaded = True
def callCommand(self, method, irc, msg, *L):
try:
callbacks.Privmsg.callCommand(self, method, irc, msg, *L)
except amazon.NoLicenseKey, e:
irc.error('You must have a free Amazon web services license key '
'in order to use this command. You can get one at '
'<http://www.amazon.com/webservices>. Once you have '
'one, you can set it with the command '
'"config supybot.plugins.Amazon.licensekey <key>".')
def _genResults(self, reply, attribs, items, url, bold, bold_item):
results = {}
res = []