mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-03 16:39:25 +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.'
|
||||||
if s:
|
try:
|
||||||
registry.String.setValue(self, s)
|
if s:
|
||||||
google.setLicense(self.value)
|
registry.String.setValue(self, s)
|
||||||
if not s:
|
google.setLicense(self.value)
|
||||||
registry.String.setValue(self, '')
|
if not s:
|
||||||
google.setLicense(self.value)
|
registry.String.setValue(self, '')
|
||||||
|
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