refactor parsers; introduce new pocsag parser

This commit is contained in:
Jakob Ketterl
2020-01-09 15:11:53 +01:00
parent 0f8c86a26c
commit 0e528c9267
6 changed files with 49 additions and 34 deletions

8
owrx/pocsag.py Normal file
View File

@ -0,0 +1,8 @@
from owrx.parser import Parser
class PocsagParser(Parser):
def parse(self, raw):
fields = raw.decode("ascii", "replace").rstrip("\n").split(";")
meta = {v[0]: "".join(v[1:]) for v in map(lambda x: x.split(":"), fields) if v[0] != ""}
self.handler.write_pocsag_data(meta)