添加好多好多 crypto
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-01-10 00:39:45 +08:00
parent 3adbd38d65
commit 16a55ae69a
4 changed files with 318 additions and 9 deletions

View File

@ -1,3 +1,5 @@
import asyncio
from abc import ABC, abstractmethod
from dataclasses import dataclass, field
from enum import Enum
@ -33,6 +35,17 @@ class TextHandler(ABC):
return f"<{self.__class__.__name__}: {self.name} [{''.join(self.keywords)}]>"
class TextHandlerSync(TextHandler):
@abstractmethod
def handle_sync(self, env: TextHandlerEnvironment, istream: str | None, args: list[str]) -> TextHandleResult:
...
async def handle(self, env: TextHandlerEnvironment, istream: str | None, args: list[str]) -> TextHandleResult:
def _hs():
return self.handle_sync(env, istream, args)
return await asyncio.to_thread(_hs)
@dataclass
class PipelineCommand:
handler: TextHandler