more localized imports

This commit is contained in:
Jakob Ketterl 2021-09-20 16:53:00 +02:00
parent 81ed1a9ebb
commit 95b4510c3a

View File

@ -1,5 +1,3 @@
from owrx.wsjt import WsjtParser
from owrx.js8 import Js8Parser
from owrx.source import SdrSourceEventClient, SdrSourceState, SdrClientClass from owrx.source import SdrSourceEventClient, SdrSourceState, SdrClientClass
from owrx.property import PropertyStack, PropertyLayer, PropertyValidator from owrx.property import PropertyStack, PropertyLayer, PropertyValidator
from owrx.property.validators import OrValidator, RegexValidator, BoolValidator from owrx.property.validators import OrValidator, RegexValidator, BoolValidator
@ -9,7 +7,6 @@ from csdr.chain.demodulator import BaseDemodulatorChain, FixedIfSampleRateChain,
from csdr.chain.selector import Selector from csdr.chain.selector import Selector
from csdr.chain.clientaudio import ClientAudioChain from csdr.chain.clientaudio import ClientAudioChain
from csdr.chain.fft import FftChain from csdr.chain.fft import FftChain
from csdr.chain.digimodes import AudioChopperDemodulator, PacketDemodulator, PocsagDemodulator
from pycsdr.modules import Buffer, Writer from pycsdr.modules import Buffer, Writer
from pycsdr.types import Format from pycsdr.types import Format
from typing import Union from typing import Union
@ -490,12 +487,18 @@ class DspManager(SdrSourceEventClient):
return mod return mod
# TODO add remaining modes # TODO add remaining modes
if mod in ["ft8", "wspr", "jt65", "jt9", "ft4", "fst4", "fst4w", "q65"]: if mod in ["ft8", "wspr", "jt65", "jt9", "ft4", "fst4", "fst4w", "q65"]:
from csdr.chain.digimodes import AudioChopperDemodulator
from owrx.wsjt import WsjtParser
return AudioChopperDemodulator(mod, WsjtParser()) return AudioChopperDemodulator(mod, WsjtParser())
elif mod == "js8": elif mod == "js8":
from csdr.chain.digimodes import AudioChopperDemodulator
from owrx.js8 import Js8Parser
return AudioChopperDemodulator(mod, Js8Parser()) return AudioChopperDemodulator(mod, Js8Parser())
elif mod == "packet": elif mod == "packet":
from csdr.chain.digimodes import PacketDemodulator
return PacketDemodulator() return PacketDemodulator()
elif mod == "pocsag": elif mod == "pocsag":
from csdr.chain.digimodes import PocsagDemodulator
return PocsagDemodulator() return PocsagDemodulator()
return None return None