mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 12:42:34 +01:00
Made drivers.module use OnlySomeStrings.
This commit is contained in:
parent
4258435d98
commit
77f2c84245
11
src/conf.py
11
src/conf.py
@ -422,13 +422,10 @@ supybot.register('drivers')
|
|||||||
supybot.drivers.register('poll', registry.Float(1.0, """Determines the default
|
supybot.drivers.register('poll', registry.Float(1.0, """Determines the default
|
||||||
length of time a driver should block waiting for input."""))
|
length of time a driver should block waiting for input."""))
|
||||||
|
|
||||||
class ValidDriverModule(registry.String):
|
class ValidDriverModule(registry.OnlySomeStrings):
|
||||||
def setValue(self, v):
|
def normalize(self, s):
|
||||||
if v not in ('socketDrivers', 'twistedDrivers', 'asyncoreDrivers'):
|
# We can't be case insensitive here. At least not without work.
|
||||||
raise registry.InvalidRegistryValue, \
|
return s
|
||||||
'Value must be one of "socketDrivers", "asyncoreDrivers", ' \
|
|
||||||
'or twistedDrivers.'
|
|
||||||
registry.String.setValue(self, v)
|
|
||||||
|
|
||||||
supybot.drivers.register('module', ValidDriverModule('socketDrivers', """
|
supybot.drivers.register('module', ValidDriverModule('socketDrivers', """
|
||||||
Determines what driver module the bot will use. socketDrivers, a simple
|
Determines what driver module the bot will use. socketDrivers, a simple
|
||||||
|
Loading…
Reference in New Issue
Block a user