Made drivers.module use OnlySomeStrings.

This commit is contained in:
Jeremy Fincher 2004-04-08 10:50:05 +00:00
parent 4258435d98
commit 77f2c84245

View File

@ -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