mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Better behavior in the case of a non-importing google.py.
This commit is contained in:
parent
54ccb01b5e
commit
9426acc56c
@ -135,12 +135,20 @@ class LicenseKey(registry.String):
|
|||||||
def setValue(self, s):
|
def setValue(self, s):
|
||||||
if s and len(s) != 32:
|
if s and len(s) != 32:
|
||||||
raise registry.InvalidRegistryValue, 'Invalid Google license key.'
|
raise registry.InvalidRegistryValue, 'Invalid Google license key.'
|
||||||
|
try:
|
||||||
if s:
|
if s:
|
||||||
registry.String.setValue(self, s)
|
registry.String.setValue(self, s)
|
||||||
google.setLicense(self.value)
|
google.setLicense(self.value)
|
||||||
if not s:
|
if not s:
|
||||||
registry.String.setValue(self, '')
|
registry.String.setValue(self, '')
|
||||||
google.setLicense(self.value)
|
google.setLicense(self.value)
|
||||||
|
except AttributeError:
|
||||||
|
raise callbacks.Error, 'It appears that the initial import of ' \
|
||||||
|
'out underlying google.py module has ' \
|
||||||
|
'failed. Once the cause of that problem ' \
|
||||||
|
'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 '
|
||||||
|
Loading…
Reference in New Issue
Block a user