mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-07-16 15:29:56 +00:00
refactor: replace enum with intenum and strenum
This commit is contained in:
@ -17,10 +17,10 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
from enum import Enum
|
||||
from enum import StrEnum
|
||||
|
||||
|
||||
class Action(str, Enum):
|
||||
class Action(StrEnum):
|
||||
"""
|
||||
base action enumeration
|
||||
|
||||
|
@ -19,10 +19,10 @@
|
||||
#
|
||||
from __future__ import annotations
|
||||
|
||||
from enum import Enum
|
||||
from enum import StrEnum
|
||||
|
||||
|
||||
class AuthSettings(str, Enum):
|
||||
class AuthSettings(StrEnum):
|
||||
"""
|
||||
web authorization type
|
||||
|
||||
|
@ -18,13 +18,13 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
from dataclasses import dataclass, field, fields
|
||||
from enum import Enum
|
||||
from enum import StrEnum
|
||||
from typing import Any, Self
|
||||
|
||||
from ahriman.core.util import filter_json, pretty_datetime, utcnow
|
||||
|
||||
|
||||
class BuildStatusEnum(str, Enum):
|
||||
class BuildStatusEnum(StrEnum):
|
||||
"""
|
||||
build status enumeration
|
||||
|
||||
|
@ -17,10 +17,10 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
from enum import Enum
|
||||
from enum import StrEnum
|
||||
|
||||
|
||||
class LogHandler(str, Enum):
|
||||
class LogHandler(StrEnum):
|
||||
"""
|
||||
log handler as described by default configuration
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
#
|
||||
from __future__ import annotations
|
||||
|
||||
from enum import Enum
|
||||
from enum import StrEnum
|
||||
from pathlib import Path
|
||||
from urllib.parse import urlparse
|
||||
|
||||
@ -27,7 +27,7 @@ from ahriman.core.util import package_like
|
||||
from ahriman.models.repository_paths import RepositoryPaths
|
||||
|
||||
|
||||
class PackageSource(str, Enum):
|
||||
class PackageSource(StrEnum):
|
||||
"""
|
||||
package source for addition enumeration
|
||||
|
||||
|
@ -17,10 +17,10 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
from enum import Enum
|
||||
from enum import IntEnum
|
||||
|
||||
|
||||
class PacmanSynchronization(int, Enum):
|
||||
class PacmanSynchronization(IntEnum):
|
||||
"""
|
||||
pacman database synchronization flag
|
||||
|
||||
|
@ -19,10 +19,10 @@
|
||||
#
|
||||
from __future__ import annotations
|
||||
|
||||
from enum import Enum
|
||||
from enum import StrEnum
|
||||
|
||||
|
||||
class ReportSettings(str, Enum):
|
||||
class ReportSettings(StrEnum):
|
||||
"""
|
||||
report targets enumeration
|
||||
|
||||
|
@ -19,10 +19,10 @@
|
||||
#
|
||||
from __future__ import annotations
|
||||
|
||||
from enum import Enum
|
||||
from enum import StrEnum
|
||||
|
||||
|
||||
class SignSettings(str, Enum):
|
||||
class SignSettings(StrEnum):
|
||||
"""
|
||||
sign targets enumeration
|
||||
|
||||
|
@ -19,10 +19,10 @@
|
||||
#
|
||||
from __future__ import annotations
|
||||
|
||||
from enum import Enum
|
||||
from enum import StrEnum
|
||||
|
||||
|
||||
class SmtpSSLSettings(str, Enum):
|
||||
class SmtpSSLSettings(StrEnum):
|
||||
"""
|
||||
SMTP SSL mode enumeration
|
||||
|
||||
|
@ -19,10 +19,10 @@
|
||||
#
|
||||
from __future__ import annotations
|
||||
|
||||
from enum import Enum
|
||||
from enum import StrEnum
|
||||
|
||||
|
||||
class UploadSettings(str, Enum):
|
||||
class UploadSettings(StrEnum):
|
||||
"""
|
||||
remote synchronization targets enumeration
|
||||
|
||||
|
@ -19,10 +19,10 @@
|
||||
#
|
||||
from __future__ import annotations
|
||||
|
||||
from enum import Enum
|
||||
from enum import StrEnum
|
||||
|
||||
|
||||
class UserAccess(str, Enum):
|
||||
class UserAccess(StrEnum):
|
||||
"""
|
||||
web user access enumeration
|
||||
|
||||
|
Reference in New Issue
Block a user