diff options
author | Devaev Maxim <[email protected]> | 2020-05-22 21:07:54 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-05-22 21:07:54 +0300 |
commit | 43afd9acb3a7f2c94a3515f580ec3afcee720dc2 (patch) | |
tree | e1e3031ea1f083f17751c4997f29708dfb7e5d98 /kvmd/clients | |
parent | 0fa0680bd7c28e246c70b5a5102e38a592bd0f0d (diff) |
server-side paste-as-keys
Diffstat (limited to 'kvmd/clients')
-rw-r--r-- | kvmd/clients/kvmd.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/kvmd/clients/kvmd.py b/kvmd/clients/kvmd.py index 0b33eb42..678f104e 100644 --- a/kvmd/clients/kvmd.py +++ b/kvmd/clients/kvmd.py @@ -89,6 +89,17 @@ class _StreamerClientPart(_BaseClientPart): aiotools.raise_not_200(response) +class _HidClientPart(_BaseClientPart): + async def print(self, user: str, passwd: str, text: str, limit: int) -> None: + async with self._make_session(user, passwd) as session: + async with session.post( + url=self._make_url("hid/print"), + params={"limit": limit}, + data=text, + ) as response: + aiotools.raise_not_200(response) + + class _AtxClientPart(_BaseClientPart): async def get_state(self, user: str, passwd: str) -> Dict: async with self._make_session(user, passwd) as session: @@ -134,6 +145,7 @@ class KvmdClient(_BaseClientPart): self.auth = _AuthClientPart(**kwargs) self.streamer = _StreamerClientPart(**kwargs) + self.hid = _HidClientPart(**kwargs) self.atx = _AtxClientPart(**kwargs) @contextlib.asynccontextmanager |