diff --git a/src/conf.py b/src/conf.py index 74bacb144..3239af684 100644 --- a/src/conf.py +++ b/src/conf.py @@ -423,6 +423,7 @@ supybot.drivers.register('poll', registry.Float(1.0, """Determines the default length of time a driver should block waiting for input.""")) class ValidDriverModule(registry.OnlySomeStrings): + validStrings = ('socketDrivers', 'twistedDrivers', 'asyncoreDrivers') def normalize(self, s): # We can't be case insensitive here. At least not without work. return s diff --git a/src/registry.py b/src/registry.py index 95abb13eb..06b18e0b5 100644 --- a/src/registry.py +++ b/src/registry.py @@ -299,6 +299,11 @@ class String(Value): class OnlySomeStrings(String): normalize = staticmethod(str.lower) validStrings = () + def __init__(self, *args, **kwargs): + assert self.validStrings, 'There must be some valid strings. ' \ + 'This is a bug.' + String.__init__(self, *args, **kwargs) + def setValue(self, s): s = self.normalize(s) if s in self.validStrings: