mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
move 'StrEnum' to lib
This commit is contained in:
parent
1e1828bbdc
commit
bd94d7ede6
3 changed files with 12 additions and 8 deletions
|
|
@ -1,11 +1,4 @@
|
|||
from enum import Enum
|
||||
|
||||
|
||||
class StrEnum(str, Enum):
|
||||
"""A string-based Enum class that allows for string comparison."""
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.value
|
||||
from ayon_core.lib import StrEnum
|
||||
|
||||
|
||||
class ContextChangeReason(StrEnum):
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
# flake8: noqa E402
|
||||
"""AYON lib functions."""
|
||||
|
||||
from ._compatibility import StrEnum
|
||||
from .local_settings import (
|
||||
IniSettingRegistry,
|
||||
JSONSettingRegistry,
|
||||
|
|
@ -140,6 +141,8 @@ from .ayon_info import (
|
|||
terminal = Terminal
|
||||
|
||||
__all__ = [
|
||||
"StrEnum",
|
||||
|
||||
"IniSettingRegistry",
|
||||
"JSONSettingRegistry",
|
||||
"AYONSecureRegistry",
|
||||
|
|
|
|||
8
client/ayon_core/lib/_compatibility.py
Normal file
8
client/ayon_core/lib/_compatibility.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
from enum import Enum
|
||||
|
||||
|
||||
class StrEnum(str, Enum):
|
||||
"""A string-based Enum class that allows for string comparison."""
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.value
|
||||
Loading…
Add table
Add a link
Reference in a new issue