Added gtk demo app

This commit is contained in:
Qubasa
2023-11-21 18:13:30 +01:00
committed by Jörg Thalheim
parent 9698e57fa6
commit dddbe74d6a
12 changed files with 164 additions and 15 deletions

View File

@@ -1,9 +1,8 @@
import asyncio
import logging
import deal
import shlex
from pathlib import Path
from typing import Any, Callable, Coroutine, Dict, NamedTuple, Optional, Awaitable
from typing import Any, Callable, Coroutine, Dict, NamedTuple, Optional
from .custom_logger import get_caller
from .errors import ClanError
@@ -16,8 +15,8 @@ class CmdOut(NamedTuple):
stderr: str
cwd: Optional[Path] = None
@deal.raises(ClanError)
async def run(cmd: list[str], cwd: Optional[Path] = None) -> Awaitable[CmdOut]:
async def run(cmd: list[str], cwd: Optional[Path] = None) -> CmdOut:
cwd_res = None
if cwd is not None:
if not cwd.exists():
@@ -52,7 +51,6 @@ stdout:
return CmdOut(stdout.decode("utf-8"), stderr.decode("utf-8"), cwd=cwd)
@deal.raises(ClanError)
def runforcli(
func: Callable[..., Coroutine[Any, Any, Dict[str, CmdOut]]], *args: Any
) -> None: