From d07cbb2b1054ad128fb16b67d18c9f243d6a8c0b Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sun, 5 Apr 2020 21:48:05 +0200 Subject: [PATCH] more abc --- owrx/wsjt.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/owrx/wsjt.py b/owrx/wsjt.py index 8ea00bc..982e475 100644 --- a/owrx/wsjt.py +++ b/owrx/wsjt.py @@ -11,7 +11,7 @@ from owrx.config import Config from owrx.metrics import Metrics, CounterMetric, DirectMetric from owrx.pskreporter import PskReporter from owrx.parser import Parser -from abc import ABCMeta, abstractmethod +from abc import ABC, ABCMeta, abstractmethod import logging @@ -333,13 +333,17 @@ class WsjtParser(Parser): metric.inc() -class Decoder(object): +class Decoder(ABC): def parse_timestamp(self, instring, dateformat): ts = datetime.strptime(instring, dateformat) return int( datetime.combine(datetime.utcnow().date(), ts.time()).replace(tzinfo=timezone.utc).timestamp() * 1000 ) + @abstractmethod + def parse(self, msg, dial_freq): + pass + class Jt9Decoder(Decoder): locator_pattern = re.compile("[A-Z0-9]+\\s([A-Z0-9]+)\\s([A-R]{2}[0-9]{2})$")