more abc
This commit is contained in:
parent
8fdf263e4b
commit
d07cbb2b10
@ -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})$")
|
||||
|
Loading…
Reference in New Issue
Block a user