From 2f21746d2436f4212e4d2fb37c68e2f4f8640dd2 Mon Sep 17 00:00:00 2001 From: Elaina Date: Tue, 24 Sep 2024 05:39:56 +0800 Subject: [PATCH] sistana: move/simplify util module --- src/arclet/alconna/sistana/__init__.py | 2 +- src/arclet/alconna/sistana/analyzer.py | 2 +- src/arclet/alconna/sistana/fragment.py | 2 +- src/arclet/alconna/sistana/model/capture.py | 2 +- src/arclet/alconna/sistana/model/fragment.py | 2 +- src/arclet/alconna/sistana/model/mix.py | 2 +- src/arclet/alconna/sistana/model/receiver.py | 2 +- src/arclet/alconna/sistana/model/snapshot.py | 2 +- src/arclet/alconna/sistana/{utils/misc.py => some.py} | 0 src/arclet/alconna/sistana/utils/__init__.py | 0 10 files changed, 8 insertions(+), 8 deletions(-) rename src/arclet/alconna/sistana/{utils/misc.py => some.py} (100%) delete mode 100644 src/arclet/alconna/sistana/utils/__init__.py diff --git a/src/arclet/alconna/sistana/__init__.py b/src/arclet/alconna/sistana/__init__.py index cf5f2a04..e25b8585 100644 --- a/src/arclet/alconna/sistana/__init__.py +++ b/src/arclet/alconna/sistana/__init__.py @@ -33,4 +33,4 @@ from .model import SubcommandPattern as SubcommandPattern from .model import SubcommandTraverse as SubcommandTraverse from .model import Track as Track -from .utils.misc import Value as Value \ No newline at end of file +from .some import Value as Value \ No newline at end of file diff --git a/src/arclet/alconna/sistana/analyzer.py b/src/arclet/alconna/sistana/analyzer.py index 0e477896..7522362a 100644 --- a/src/arclet/alconna/sistana/analyzer.py +++ b/src/arclet/alconna/sistana/analyzer.py @@ -10,7 +10,7 @@ from .err import ParsePanic, Rejected from .model.pointer import PointerRole from .model.snapshot import AnalyzeSnapshot, OptionTraverse, SubcommandTraverse -from .utils.misc import Value +from .some import Value T = TypeVar("T") diff --git a/src/arclet/alconna/sistana/fragment.py b/src/arclet/alconna/sistana/fragment.py index d3d2064c..e3892815 100644 --- a/src/arclet/alconna/sistana/fragment.py +++ b/src/arclet/alconna/sistana/fragment.py @@ -8,7 +8,7 @@ from .model.capture import RegexCapture from .model.fragment import _Fragment -from .utils.misc import Some +from .some import Some if TYPE_CHECKING: from nepattern import BasePattern diff --git a/src/arclet/alconna/sistana/model/capture.py b/src/arclet/alconna/sistana/model/capture.py index 42ab49f7..01c44df5 100644 --- a/src/arclet/alconna/sistana/model/capture.py +++ b/src/arclet/alconna/sistana/model/capture.py @@ -9,7 +9,7 @@ from arclet.alconna._dcls import safe_dcls_kw -from ..utils.misc import Some, Value +from ..some import Some, Value from elaina_segment.buffer import AheadToken, Buffer, SegmentToken from ..err import RegexMismatch, UnexpectedType diff --git a/src/arclet/alconna/sistana/model/fragment.py b/src/arclet/alconna/sistana/model/fragment.py index 2837cb72..315e3ead 100644 --- a/src/arclet/alconna/sistana/model/fragment.py +++ b/src/arclet/alconna/sistana/model/fragment.py @@ -5,7 +5,7 @@ from arclet.alconna._dcls import safe_dcls_kw -from ..utils.misc import Some +from ..some import Some from .capture import Capture, SimpleCapture from .receiver import Rx diff --git a/src/arclet/alconna/sistana/model/mix.py b/src/arclet/alconna/sistana/model/mix.py index 4fd2a244..7911ce33 100644 --- a/src/arclet/alconna/sistana/model/mix.py +++ b/src/arclet/alconna/sistana/model/mix.py @@ -4,7 +4,7 @@ from typing import TYPE_CHECKING, Any, Iterable from ..err import CaptureRejected, ReceivePanic, TransformPanic, ValidateRejected -from ..utils.misc import Value +from ..some import Value from .fragment import _Fragment, assert_fragments_order if TYPE_CHECKING: diff --git a/src/arclet/alconna/sistana/model/receiver.py b/src/arclet/alconna/sistana/model/receiver.py index a940242d..0a0eddd8 100644 --- a/src/arclet/alconna/sistana/model/receiver.py +++ b/src/arclet/alconna/sistana/model/receiver.py @@ -2,7 +2,7 @@ from typing import Any, Callable, Generic, TypeVar -from ..utils.misc import Some +from ..some import Some T = TypeVar("T") diff --git a/src/arclet/alconna/sistana/model/snapshot.py b/src/arclet/alconna/sistana/model/snapshot.py index 0792690a..49d727c0 100644 --- a/src/arclet/alconna/sistana/model/snapshot.py +++ b/src/arclet/alconna/sistana/model/snapshot.py @@ -3,7 +3,7 @@ from collections import defaultdict from typing import TYPE_CHECKING, Generic, TypeVar -from ..utils.misc import Some, Value +from ..some import Some, Value if TYPE_CHECKING: from .pattern import SubcommandPattern, OptionPattern diff --git a/src/arclet/alconna/sistana/utils/misc.py b/src/arclet/alconna/sistana/some.py similarity index 100% rename from src/arclet/alconna/sistana/utils/misc.py rename to src/arclet/alconna/sistana/some.py diff --git a/src/arclet/alconna/sistana/utils/__init__.py b/src/arclet/alconna/sistana/utils/__init__.py deleted file mode 100644 index e69de29b..00000000