use abc
This commit is contained in:
parent
2301141b44
commit
366def0235
@ -11,6 +11,7 @@ from owrx.config import Config
|
|||||||
from owrx.metrics import Metrics, CounterMetric, DirectMetric
|
from owrx.metrics import Metrics, CounterMetric, DirectMetric
|
||||||
from owrx.pskreporter import PskReporter
|
from owrx.pskreporter import PskReporter
|
||||||
from owrx.parser import Parser
|
from owrx.parser import Parser
|
||||||
|
from abc import ABCMeta, abstractmethod
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
@ -85,7 +86,7 @@ class WsjtQueue(Queue):
|
|||||||
self.errorCounter.inc()
|
self.errorCounter.inc()
|
||||||
|
|
||||||
|
|
||||||
class WsjtChopper(threading.Thread):
|
class WsjtChopper(threading.Thread, metaclass=ABCMeta):
|
||||||
def __init__(self, source):
|
def __init__(self, source):
|
||||||
self.source = source
|
self.source = source
|
||||||
self.tmp_dir = Config.get()["temporary_directory"]
|
self.tmp_dir = Config.get()["temporary_directory"]
|
||||||
@ -140,11 +141,9 @@ class WsjtChopper(threading.Thread):
|
|||||||
os.unlink(filename)
|
os.unlink(filename)
|
||||||
self._scheduleNextSwitch()
|
self._scheduleNextSwitch()
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
def decoder_commandline(self, file):
|
def decoder_commandline(self, file):
|
||||||
"""
|
pass
|
||||||
must be overridden in child classes
|
|
||||||
"""
|
|
||||||
return []
|
|
||||||
|
|
||||||
def decode(self, file):
|
def decode(self, file):
|
||||||
decoder = subprocess.Popen(
|
decoder = subprocess.Popen(
|
||||||
|
Loading…
Reference in New Issue
Block a user