Skip to content

Commit fefbbee

Browse files
authored
Fix constants (#63)
1 parent a71c1b6 commit fefbbee

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

trinity/common/constants.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ def __getattr__(cls, name):
2323
return cls[name.upper()]
2424
return super().__getattr__(name)
2525

26+
def __call__(cls, value, *args, **kwargs):
27+
return super().__call__(value.lower(), *args, **kwargs)
28+
2629

2730
class CaseInsensitiveEnum(Enum, metaclass=CaseInsensitiveEnumMeta):
2831
pass
@@ -47,11 +50,11 @@ class ReadStrategy(CaseInsensitiveEnum):
4750
"""Pop Strategy."""
4851

4952
DEFAULT = None
50-
FIFO = "FIFO"
51-
RANDOM = "RANDOM"
52-
LRU = "LRU"
53-
LFU = "LFU"
54-
PRIORITY = "PRIORITY"
53+
FIFO = "fifo"
54+
RANDOM = "random"
55+
LRU = "lru"
56+
LFU = "lfu"
57+
PRIORITY = "priority"
5558

5659

5760
class StorageType(CaseInsensitiveEnum):

0 commit comments

Comments
 (0)