summaryrefslogtreecommitdiff
path: root/kvmd/streamer.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-10-10 00:51:08 +0300
committerDevaev Maxim <[email protected]>2018-10-10 00:51:08 +0300
commit95bc1536b23a17637188108a581a1b47bdd23daa (patch)
tree5bc804a3dbaf4bf19c67e82e1e59aba3fdc76470 /kvmd/streamer.py
parenta449b39c52392d0d8b043934a15792f21d54e06d (diff)
show streamer version
Diffstat (limited to 'kvmd/streamer.py')
-rw-r--r--kvmd/streamer.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/kvmd/streamer.py b/kvmd/streamer.py
index 8a23c715..f4c49bf2 100644
--- a/kvmd/streamer.py
+++ b/kvmd/streamer.py
@@ -1,3 +1,4 @@
+import os
import asyncio
import asyncio.subprocess
@@ -64,6 +65,18 @@ class Streamer: # pylint: disable=too-many-instance-attributes
"quality": self.__quality,
}
+ def get_app(self) -> str:
+ return os.path.basename(self.__cmd[0])
+
+ async def get_version(self) -> str:
+ proc = await asyncio.create_subprocess_exec(
+ *[self.__cmd[0], "--version"],
+ stdout=asyncio.subprocess.PIPE,
+ stderr=asyncio.subprocess.DEVNULL,
+ )
+ (stdout, _) = await proc.communicate()
+ return stdout.decode(errors="ignore").strip()
+
async def cleanup(self) -> None:
if self.is_running():
await self.stop()