From 713ae59a300a70165497bbfbfe7bb00a5f6fdaa6 Mon Sep 17 00:00:00 2001 From: Andrei Date: Sat, 18 Jan 2025 05:17:21 +0300 Subject: [PATCH] Update enum.py --- src/python3_capsolver/core/enum.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/python3_capsolver/core/enum.py b/src/python3_capsolver/core/enum.py index 721cabe8..0064abb7 100644 --- a/src/python3_capsolver/core/enum.py +++ b/src/python3_capsolver/core/enum.py @@ -1,8 +1,10 @@ from enum import Enum from typing import List +__all__ = ("EndpointPostfixEnm", "CaptchaTypeEnm", "ResponseStatusEnm", "SaveFormatsEnm") -class MyEnum(Enum): + +class MyEnum(str, Enum): @classmethod def list(cls) -> List[Enum]: return list(map(lambda c: c, cls)) @@ -16,7 +18,7 @@ def list_names(cls) -> List[str]: return list(map(lambda c: c.name, cls)) -class EndpointPostfixEnm(str, MyEnum): +class EndpointPostfixEnm(MyEnum): """ Enum stored URL postfixes for API endpoints """ @@ -26,7 +28,7 @@ class EndpointPostfixEnm(str, MyEnum): GET_TASK_RESULT = "getTaskResult" -class CaptchaTypeEnm(str, MyEnum): +class CaptchaTypeEnm(MyEnum): Control = "Control" ImageToTextTask = "ImageToTextTask" @@ -63,7 +65,7 @@ class CaptchaTypeEnm(str, MyEnum): AwsWafClassification = "AwsWafClassification" -class ResponseStatusEnm(str, MyEnum): +class ResponseStatusEnm(MyEnum): """ Enum store results `status` field variants @@ -77,6 +79,6 @@ class ResponseStatusEnm(str, MyEnum): Failed = "failed" # Task failed, check the errorDescription to know why failed. -class SaveFormatsEnm(str, MyEnum): +class SaveFormatsEnm(MyEnum): TEMP = "temp" CONST = "const"