2020-01-09 14:11:53 +00:00
|
|
|
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] != ""}
|
2020-01-10 21:11:57 +00:00
|
|
|
if "address" in meta:
|
|
|
|
meta["address"] = int(meta["address"])
|
2020-01-09 14:11:53 +00:00
|
|
|
self.handler.write_pocsag_data(meta)
|