mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Made sure we can normalize for OnlySomeStrings.
This commit is contained in:
parent
c97d3905c5
commit
46a3f07491
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user