Made sure we can normalize for OnlySomeStrings.

This commit is contained in:
Jeremy Fincher 2004-04-08 02:18:35 +00:00
parent c97d3905c5
commit 46a3f07491

View File

@ -297,8 +297,10 @@ class String(Value):
raise InvalidRegistryValue, '%r is not a string.' % s raise InvalidRegistryValue, '%r is not a string.' % s
class OnlySomeStrings(String): class OnlySomeStrings(String):
normalize = staticmethod(str.lower)
validStrings = () validStrings = ()
def setValue(self, s): def setValue(self, s):
s = self.normalize(s)
if s in self.validStrings: if s in self.validStrings:
String.setValue(self, s) String.setValue(self, s)
else: else: