Small addition to patterns.py
parent
5be1636b10
commit
52c1850655
|
@ -64,8 +64,8 @@ class BooleanConstant(_Constant):
|
||||||
self.value = value
|
self.value = value
|
||||||
return
|
return
|
||||||
|
|
||||||
trues = ['true', 't']
|
trues = ['true', 't', '1']
|
||||||
falses = ['false', 'f']
|
falses = ['false', 'f', '0']
|
||||||
try:
|
try:
|
||||||
if value.lower() in trues:
|
if value.lower() in trues:
|
||||||
self.value = True
|
self.value = True
|
||||||
|
@ -112,7 +112,7 @@ class HashConstant(StringConstant):
|
||||||
vocab_key = _HASH_REGEX[key][1]
|
vocab_key = _HASH_REGEX[key][1]
|
||||||
if not re.match(_HASH_REGEX[key][0], value):
|
if not re.match(_HASH_REGEX[key][0], value):
|
||||||
raise ValueError("'%s' is not a valid %s hash" % (value, vocab_key))
|
raise ValueError("'%s' is not a valid %s hash" % (value, vocab_key))
|
||||||
self.value = value
|
super(HashConstant, self).__init__(value)
|
||||||
|
|
||||||
|
|
||||||
class BinaryConstant(_Constant):
|
class BinaryConstant(_Constant):
|
||||||
|
|
Loading…
Reference in New Issue