Add function to clean path into just digi callsigns

This commit is contained in:
Bill Mitchell 2018-04-03 22:40:08 -05:00
parent 94b89a6da4
commit 6f15883b63
1 changed files with 16 additions and 0 deletions

View File

@ -62,6 +62,7 @@ def parse_header(head):
'from': fromcall,
'to': tocall,
'path': path,
'digipath': digipath,
}
viacall = ""
@ -73,6 +74,21 @@ def parse_header(head):
return parsed
def remove_WIDEn_N(path):
"""
Remove WIDEn-N entries and * markers from path, leaving only digi names
path: path of parsed packet (list of strings)
returns: list of digipeaters that digipeated packet, in order
"""
digipath = []
for digi in path:
digi = re.sub('\*','',digi) # Get rid of * markers
if not re.match('WIDE[0-9]-*[0-9]*',digi): # check for not WIDEn-N
digipath.append(digi)
return digipath
def parse_timestamp(body, packet_type=''):
parsed = {}