refactor parsers; introduce new pocsag parser
This commit is contained in:
8
owrx/pocsag.py
Normal file
8
owrx/pocsag.py
Normal 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)
|
Reference in New Issue
Block a user