From e4af28c4a398cd87378d3833b1d25db0f291ac9e Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Fri, 9 Oct 2026 11:35:11 +0500 Subject: upgrade to StrEnum --- vk/tracking/db/format.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'vk/tracking/db') diff --git a/vk/tracking/db/format.py b/vk/tracking/db/format.py index 7c5ff33..29f5c4c 100644 --- a/vk/tracking/db/format.py +++ b/vk/tracking/db/format.py @@ -3,7 +3,7 @@ # For details, see https://github.com/egor-tensin/vk-scripts # Distributed under the MIT License. -from enum import Enum +from enum import auto, StrEnum import sys from vk.utils import io @@ -11,13 +11,10 @@ from vk.utils import io from . import backend -class Format(Enum): - CSV = "csv" - LOG = "log" - NULL = "null" - - def __str__(self): - return self.value +class Format(StrEnum): + CSV = auto() + LOG = auto() + NULL = auto() def create_writer(self, fd=sys.stdout): if self is Format.CSV: -- cgit v1.3