Skip to content

Commit 713ae59

Browse files
committed
Update enum.py
1 parent 8051961 commit 713ae59

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/python3_capsolver/core/enum.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
from enum import Enum
22
from typing import List
33

4+
__all__ = ("EndpointPostfixEnm", "CaptchaTypeEnm", "ResponseStatusEnm", "SaveFormatsEnm")
45

5-
class MyEnum(Enum):
6+
7+
class MyEnum(str, Enum):
68
@classmethod
79
def list(cls) -> List[Enum]:
810
return list(map(lambda c: c, cls))
@@ -16,7 +18,7 @@ def list_names(cls) -> List[str]:
1618
return list(map(lambda c: c.name, cls))
1719

1820

19-
class EndpointPostfixEnm(str, MyEnum):
21+
class EndpointPostfixEnm(MyEnum):
2022
"""
2123
Enum stored URL postfixes for API endpoints
2224
"""
@@ -26,7 +28,7 @@ class EndpointPostfixEnm(str, MyEnum):
2628
GET_TASK_RESULT = "getTaskResult"
2729

2830

29-
class CaptchaTypeEnm(str, MyEnum):
31+
class CaptchaTypeEnm(MyEnum):
3032
Control = "Control"
3133

3234
ImageToTextTask = "ImageToTextTask"
@@ -63,7 +65,7 @@ class CaptchaTypeEnm(str, MyEnum):
6365
AwsWafClassification = "AwsWafClassification"
6466

6567

66-
class ResponseStatusEnm(str, MyEnum):
68+
class ResponseStatusEnm(MyEnum):
6769
"""
6870
Enum store results `status` field variants
6971
@@ -77,6 +79,6 @@ class ResponseStatusEnm(str, MyEnum):
7779
Failed = "failed" # Task failed, check the errorDescription to know why failed.
7880

7981

80-
class SaveFormatsEnm(str, MyEnum):
82+
class SaveFormatsEnm(MyEnum):
8183
TEMP = "temp"
8284
CONST = "const"

0 commit comments

Comments
 (0)