No errors on exit when google.py fails to import.

This commit is contained in:
Jeremy Fincher 2004-10-22 20:53:35 +00:00
parent 6b946aad94
commit d5241eb07a

View File

@ -51,6 +51,7 @@ import supybot.registry as registry
import supybot.conf as conf import supybot.conf as conf
import supybot.utils as utils import supybot.utils as utils
import supybot.world as world
from supybot.commands import * from supybot.commands import *
import supybot.ircmsgs as ircmsgs import supybot.ircmsgs as ircmsgs
import supybot.plugins as plugins import supybot.plugins as plugins
@ -141,12 +142,14 @@ class LicenseKey(registry.String):
if s: if s:
google.setLicense(self.value) google.setLicense(self.value)
except AttributeError: except AttributeError:
raise callbacks.Error, 'It appears that the initial import of ' \ if not world.dying:
'our underlying google.py module has ' \ raise callbacks.Error, \
'failed. Once the cause of that problem ' \ 'It appears that the initial import of ' \
'has been diagnosed and fixed, the bot ' \ 'our underlying google.py module has ' \
'will need to be restarted in order to ' \ 'failed. Once the cause of that problem ' \
'load this plugin.' 'has been diagnosed and fixed, the bot ' \
'will need to be restarted in order to ' \
'load this plugin.'
class Language(registry.OnlySomeStrings): class Language(registry.OnlySomeStrings):
validStrings = ['lang_' + s for s in 'ar zh-CN zh-TW cs da nl en et fi fr ' validStrings = ['lang_' + s for s in 'ar zh-CN zh-TW cs da nl en et fi fr '