diff --git a/owrx/form/input/validator.py b/owrx/form/input/validator.py index fc844d86..b5591ea1 100644 --- a/owrx/form/input/validator.py +++ b/owrx/form/input/validator.py @@ -1,5 +1,6 @@ from abc import ABC, abstractmethod from owrx.form.error import ValidationError +from typing import List class Validator(ABC): @@ -42,7 +43,7 @@ class RangeValidator(Validator): class RangeListValidator(Validator): - def __init__(self, rangeList: list[Range]): + def __init__(self, rangeList: List[Range]): self.rangeList = rangeList def validate(self, key, value) -> None: diff --git a/owrx/source/__init__.py b/owrx/source/__init__.py index 13841367..7da39e94 100644 --- a/owrx/source/__init__.py +++ b/owrx/source/__init__.py @@ -679,6 +679,6 @@ class SdrDeviceDescription(object): self.getProfileOptionalKeys(), ) - def getSampleRateRanges(self) -> list[Range]: + def getSampleRateRanges(self) -> List[Range]: # semi-sane default value. should be overridden with more specific values per device. return [Range(500000, 10000000)] diff --git a/owrx/source/afedri.py b/owrx/source/afedri.py index 52cc7a0e..6b69895b 100644 --- a/owrx/source/afedri.py +++ b/owrx/source/afedri.py @@ -123,5 +123,5 @@ class AfedriDeviceDescription(SoapyConnectorDeviceDescription): def getNumberOfChannels(self) -> int: return 4 - def getSampleRateRanges(self) -> list[Range]: + def getSampleRateRanges(self) -> List[Range]: return [Range(48000, 2400000)] diff --git a/owrx/source/airspy.py b/owrx/source/airspy.py index 52034446..e9815bbb 100644 --- a/owrx/source/airspy.py +++ b/owrx/source/airspy.py @@ -50,7 +50,7 @@ class AirspyDeviceDescription(SoapyConnectorDeviceDescription): def getGainStages(self): return ["LNA", "MIX", "VGA"] - def getSampleRateRanges(self) -> list[Range]: + def getSampleRateRanges(self) -> List[Range]: # Airspy R2 does 2.5 or 10 MS/s # Airspy mini does 3 or 6 MS/s # we don't know what device we're actually dealing with, but we can still clamp it down to a sum of the options. diff --git a/owrx/source/airspyhf.py b/owrx/source/airspyhf.py index 9e3c4317..8787628d 100644 --- a/owrx/source/airspyhf.py +++ b/owrx/source/airspyhf.py @@ -1,5 +1,6 @@ from owrx.source.soapy import SoapyConnectorSource, SoapyConnectorDeviceDescription from owrx.form.input.validator import Range +from typing import List class AirspyhfSource(SoapyConnectorSource): @@ -15,7 +16,7 @@ class AirspyhfDeviceDescription(SoapyConnectorDeviceDescription): # not currently supported by the SoapySDR module. return False - def getSampleRateRanges(self) -> list[Range]: + def getSampleRateRanges(self) -> List[Range]: return [ Range(192000), Range(256000), diff --git a/owrx/source/bladerf.py b/owrx/source/bladerf.py index 030817b6..af57aab1 100644 --- a/owrx/source/bladerf.py +++ b/owrx/source/bladerf.py @@ -1,5 +1,6 @@ from owrx.source.soapy import SoapyConnectorSource, SoapyConnectorDeviceDescription from owrx.form.input.validator import Range +from typing import List class BladerfSource(SoapyConnectorSource): @@ -11,5 +12,5 @@ class BladerfDeviceDescription(SoapyConnectorDeviceDescription): def getName(self): return "Blade RF" - def getSampleRateRanges(self) -> list[Range]: + def getSampleRateRanges(self) -> List[Range]: return [Range(160000, 40000000)] diff --git a/owrx/source/fcdpp.py b/owrx/source/fcdpp.py index b12b9f7b..ca614c72 100644 --- a/owrx/source/fcdpp.py +++ b/owrx/source/fcdpp.py @@ -1,5 +1,6 @@ from owrx.source.soapy import SoapyConnectorSource, SoapyConnectorDeviceDescription from owrx.form.input.validator import Range +from typing import List class FcdppSource(SoapyConnectorSource): @@ -11,7 +12,7 @@ class FcdppDeviceDescription(SoapyConnectorDeviceDescription): def getName(self): return "FunCube Dongle Pro+" - def getSampleRateRanges(self) -> list[Range]: + def getSampleRateRanges(self) -> List[Range]: return [ Range(96000), Range(192000), diff --git a/owrx/source/fifi_sdr.py b/owrx/source/fifi_sdr.py index 02ba25d3..027c0037 100644 --- a/owrx/source/fifi_sdr.py +++ b/owrx/source/fifi_sdr.py @@ -71,7 +71,7 @@ class FifiSdrDeviceDescription(DirectSourceDeviceDescription): def getDeviceOptionalKeys(self): return super().getDeviceOptionalKeys() + ["device"] - def getSampleRateRanges(self) -> list[Range]: + def getSampleRateRanges(self) -> List[Range]: return [ Range(48000), Range(96000), diff --git a/owrx/source/hackrf.py b/owrx/source/hackrf.py index 9791e800..5fbb96a3 100644 --- a/owrx/source/hackrf.py +++ b/owrx/source/hackrf.py @@ -36,5 +36,5 @@ class HackrfDeviceDescription(SoapyConnectorDeviceDescription): def getGainStages(self): return ["LNA", "AMP", "VGA"] - def getSampleRateRanges(self) -> list[Range]: + def getSampleRateRanges(self) -> List[Range]: return [Range(1000000, 20000000)] diff --git a/owrx/source/hpsdr.py b/owrx/source/hpsdr.py index 5c9b0468..612e4202 100644 --- a/owrx/source/hpsdr.py +++ b/owrx/source/hpsdr.py @@ -90,7 +90,7 @@ class HpsdrDeviceDescription(ConnectorDeviceDescription): def getProfileOptionalKeys(self): return list(filter(lambda x : x != "iqswap", super().getProfileOptionalKeys())) - def getSampleRateRanges(self) -> list[Range]: + def getSampleRateRanges(self) -> List[Range]: return [ Range(48000), Range(96000), diff --git a/owrx/source/lime_sdr.py b/owrx/source/lime_sdr.py index 069a3b66..186d2558 100644 --- a/owrx/source/lime_sdr.py +++ b/owrx/source/lime_sdr.py @@ -1,5 +1,6 @@ from owrx.source.soapy import SoapyConnectorSource, SoapyConnectorDeviceDescription from owrx.form.input.validator import Range +from typing import List class LimeSdrSource(SoapyConnectorSource): @@ -11,5 +12,5 @@ class LimeSdrDeviceDescription(SoapyConnectorDeviceDescription): def getName(self): return "LimeSDR device" - def getSampleRateRanges(self) -> list[Range]: + def getSampleRateRanges(self) -> List[Range]: return [Range(100000, 65000000)] diff --git a/owrx/source/perseussdr.py b/owrx/source/perseussdr.py index 00eb22da..b3656d6a 100644 --- a/owrx/source/perseussdr.py +++ b/owrx/source/perseussdr.py @@ -83,7 +83,7 @@ class PerseussdrDeviceDescription(DirectSourceDeviceDescription): "wideband", ] - def getSampleRateRanges(self) -> list[Range]: + def getSampleRateRanges(self) -> List[Range]: return [ Range(125000), Range(250000), diff --git a/owrx/source/pluto_sdr.py b/owrx/source/pluto_sdr.py index a73eb20a..bcab81e0 100644 --- a/owrx/source/pluto_sdr.py +++ b/owrx/source/pluto_sdr.py @@ -1,5 +1,6 @@ from owrx.source.soapy import SoapyConnectorSource, SoapyConnectorDeviceDescription from owrx.form.input.validator import Range +from typing import List class PlutoSdrSource(SoapyConnectorSource): @@ -11,5 +12,5 @@ class PlutoSdrDeviceDescription(SoapyConnectorDeviceDescription): def getName(self): return "PlutoSDR" - def getSampleRateRanges(self) -> list[Range]: + def getSampleRateRanges(self) -> List[Range]: return [Range(520833, 61440000)] diff --git a/owrx/source/radioberry.py b/owrx/source/radioberry.py index 0fa9b08d..5d2dbe4a 100644 --- a/owrx/source/radioberry.py +++ b/owrx/source/radioberry.py @@ -1,5 +1,6 @@ from owrx.source.soapy import SoapyConnectorSource, SoapyConnectorDeviceDescription from owrx.form.input.validator import Range +from typing import List class RadioberrySource(SoapyConnectorSource): @@ -11,7 +12,7 @@ class RadioberryDeviceDescription(SoapyConnectorDeviceDescription): def getName(self): return "RadioBerry" - def getSampleRateRanges(self) -> list[Range]: + def getSampleRateRanges(self) -> List[Range]: return [ Range(48000), Range(96000), diff --git a/owrx/source/rtl_sdr.py b/owrx/source/rtl_sdr.py index c1f2c68e..1c23e957 100644 --- a/owrx/source/rtl_sdr.py +++ b/owrx/source/rtl_sdr.py @@ -37,5 +37,5 @@ class RtlSdrDeviceDescription(ConnectorDeviceDescription): def getProfileOptionalKeys(self): return super().getProfileOptionalKeys() + ["bias_tee", "direct_sampling"] - def getSampleRateRanges(self) -> list[Range]: + def getSampleRateRanges(self) -> List[Range]: return [Range(250000, 3200000)] diff --git a/owrx/source/rtl_sdr_soapy.py b/owrx/source/rtl_sdr_soapy.py index ffea9c6f..541a970b 100644 --- a/owrx/source/rtl_sdr_soapy.py +++ b/owrx/source/rtl_sdr_soapy.py @@ -28,5 +28,5 @@ class RtlSdrSoapyDeviceDescription(SoapyConnectorDeviceDescription): def getProfileOptionalKeys(self): return super().getProfileOptionalKeys() + ["bias_tee", "direct_sampling"] - def getSampleRateRanges(self) -> list[Range]: + def getSampleRateRanges(self) -> List[Range]: return [Range(250000, 3200000)] diff --git a/owrx/source/rtl_tcp.py b/owrx/source/rtl_tcp.py index 5f895574..3375fe75 100644 --- a/owrx/source/rtl_tcp.py +++ b/owrx/source/rtl_tcp.py @@ -38,5 +38,5 @@ class RtlTcpDeviceDescription(ConnectorDeviceDescription): def getProfileOptionalKeys(self): return super().getProfileOptionalKeys() + ["direct_sampling"] - def getSampleRateRanges(self) -> list[Range]: + def getSampleRateRanges(self) -> List[Range]: return [Range(250000, 3200000)] diff --git a/owrx/source/runds.py b/owrx/source/runds.py index 7c94a9b9..b1a86416 100644 --- a/owrx/source/runds.py +++ b/owrx/source/runds.py @@ -58,6 +58,6 @@ class RundsDeviceDescription(ConnectorDeviceDescription): def getDeviceOptionalKeys(self): return super().getDeviceOptionalKeys() + ["protocol", "long"] - def getSampleRateRanges(self) -> list[Range]: + def getSampleRateRanges(self) -> List[Range]: # can't be very specific here due to the wide range of devices, so this is more of a sanity check. return [Range(0, 20000000)] diff --git a/owrx/source/sddc.py b/owrx/source/sddc.py index 23dfba77..b30655a9 100644 --- a/owrx/source/sddc.py +++ b/owrx/source/sddc.py @@ -1,5 +1,6 @@ from owrx.source.connector import ConnectorSource, ConnectorDeviceDescription from owrx.form.input.validator import Range +from typing import List class SddcSource(ConnectorSource): @@ -14,6 +15,6 @@ class SddcDeviceDescription(ConnectorDeviceDescription): def hasAgc(self): return False - def getSampleRateRanges(self) -> list[Range]: + def getSampleRateRanges(self) -> List[Range]: # resampling is done in software... it can't cover the full range, but it's not finished either. return [Range(0, 64000000)] diff --git a/owrx/source/sdrplay.py b/owrx/source/sdrplay.py index 7a29dfb0..7fc79743 100644 --- a/owrx/source/sdrplay.py +++ b/owrx/source/sdrplay.py @@ -61,7 +61,7 @@ class SdrplayDeviceDescription(SoapyConnectorDeviceDescription): "bias_tee", "rf_notch", "dab_notch", "external_reference", "hdr_ctrl" ] - def getSampleRateRanges(self) -> list[Range]: + def getSampleRateRanges(self) -> List[Range]: # this is from SoapySDRPlay3's implementation of listSampleRates(). # i don't think it's accurate, but this is the limitation we'd be running into if we had proper soapy # integration. diff --git a/owrx/source/uhd.py b/owrx/source/uhd.py index ef4dd9b6..5c1809fd 100644 --- a/owrx/source/uhd.py +++ b/owrx/source/uhd.py @@ -1,5 +1,6 @@ from owrx.source.soapy import SoapyConnectorSource, SoapyConnectorDeviceDescription from owrx.form.input.validator import Range +from typing import List class UhdSource(SoapyConnectorSource): @@ -11,6 +12,6 @@ class UhdDeviceDescription(SoapyConnectorDeviceDescription): def getName(self): return "Ettus Research USRP device" - def getSampleRateRanges(self) -> list[Range]: + def getSampleRateRanges(self) -> List[Range]: # not sure since this depends of the specific model return [Range(0, 64000000)]