From 83feb2c0e01e8cee268db5a0b0e00a1b64214e86 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Mon, 17 May 2021 23:57:37 +0200 Subject: [PATCH] parse individual connector versions --- debian/control | 4 ++-- owrx/feature.py | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/debian/control b/debian/control index 992b945..07b34b0 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,7 @@ Vcs-Git: https://github.com/jketterl/openwebrx.git Package: openwebrx Architecture: all -Depends: adduser, python3 (>= 3.5), python3-pkg-resources, csdr (>= 0.17), netcat, owrx-connector (>= 0.4), soapysdr-tools, python3-js8py (>= 0.1), ${python3:Depends}, ${misc:Depends} -Recommends: digiham (>= 0.4), dsd (>= 1.7), sox, direwolf (>= 1.4), wsjtx, runds-connector, hpsdrconnector, aprs-symbols, m17-demod, js8call +Depends: adduser, python3 (>= 3.5), python3-pkg-resources, csdr (>= 0.17), netcat, owrx-connector (>= 0.5), soapysdr-tools, python3-js8py (>= 0.1), ${python3:Depends}, ${misc:Depends} +Recommends: digiham (>= 0.4), dsd (>= 1.7), sox, direwolf (>= 1.4), wsjtx, runds-connector (>= 0.2), hpsdrconnector, aprs-symbols, m17-demod, js8call Description: multi-user web sdr Open source, multi-user SDR receiver with a web interface diff --git a/owrx/feature.py b/owrx/feature.py index 647bd5e..2344e57 100644 --- a/owrx/feature.py +++ b/owrx/feature.py @@ -263,10 +263,8 @@ class FeatureDetector(object): True, ) - def _check_connector(self, command): - required_version = LooseVersion("0.4") - - owrx_connector_version_regex = re.compile("^owrx-connector version (.*)$") + def _check_connector(self, command, required_version): + owrx_connector_version_regex = re.compile("^{} version (.*)$".format(re.escape(command))) try: process = subprocess.Popen([command, "--version"], stdout=subprocess.PIPE) @@ -279,6 +277,9 @@ class FeatureDetector(object): except FileNotFoundError: return False + def _check_owrx_connector(self, command): + return self._check_connector(command, LooseVersion("0.4")) + def has_rtl_connector(self): """ The owrx_connector package offers direct interfacing between your hardware and openwebrx. It allows quicker @@ -286,7 +287,7 @@ class FeatureDetector(object): You can get it [here](https://github.com/jketterl/owrx_connector). """ - return self._check_connector("rtl_connector") + return self._check_owrx_connector("rtl_connector") def has_rtl_tcp_connector(self): """ @@ -295,7 +296,7 @@ class FeatureDetector(object): You can get it [here](https://github.com/jketterl/owrx_connector). """ - return self._check_connector("rtl_tcp_connector") + return self._check_owrx_connector("rtl_tcp_connector") def has_soapy_connector(self): """ @@ -304,7 +305,7 @@ class FeatureDetector(object): You can get it [here](https://github.com/jketterl/owrx_connector). """ - return self._check_connector("soapy_connector") + return self._check_owrx_connector("soapy_connector") def _has_soapy_driver(self, driver): try: @@ -535,7 +536,7 @@ class FeatureDetector(object): You can find more information [here](https://github.com/jketterl/sddc_connector). """ - return self._check_connector("sddc_connector") + return self._check_connector("sddc_connector", LooseVersion("0.1")) def has_hpsdr_connector(self): """ @@ -550,4 +551,4 @@ class FeatureDetector(object): You can find more information [here](https://github.com/jketterl/runds_connector). """ - return self._check_connector("runds_connector") + return self._check_connector("runds_connector", LooseVersion("0.2"))