diff options
| author | Egor Tensin <egor@tensin.name> | 2026-10-09 11:35:11 +0500 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-10-09 11:35:11 +0500 |
| commit | e4af28c4a398cd87378d3833b1d25db0f291ac9e (patch) | |
| tree | 5cbd3dbe7c08a11da0d99c1bc7409bc1bea4c63d /vk/tracking/db | |
| parent | test: remove matplotlib workaround (diff) | |
| download | vk-scripts-e4af28c4a398cd87378d3833b1d25db0f291ac9e.tar.gz vk-scripts-e4af28c4a398cd87378d3833b1d25db0f291ac9e.zip | |
upgrade to StrEnum
Diffstat (limited to 'vk/tracking/db')
| -rw-r--r-- | vk/tracking/db/format.py | 13 |
1 files changed, 5 insertions, 8 deletions
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: |
