Skip to content

Commit

Permalink
give up on trying to find all range errors and just add a try/except …
Browse files Browse the repository at this point in the history
…wrapper.
  • Loading branch information
n2ygk committed Jun 9, 2013
1 parent 6bcdec1 commit aec0edb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions aprspig.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
if 'outputSchema' not in locals():
from pigDecorators import *

@outputSchema("time:chararray,from_call:chararray,to_call:chararray,digis:chararray,gtype:chararray,gate:chararray,info:chararray,firsthop:chararray")
def aprs(l):
def parse_aprs(l):
"""
Parse APRS packet into attributes useable by Pig.
Given an input string collected from APRS-IS (preceded by a timestamp),
Expand Down Expand Up @@ -62,6 +61,13 @@ def aprs(l):
firsthop=gate
return time,from_call,to_call,digis,gtype,gate,info,firsthop

@outputSchema("time:chararray,from_call:chararray,to_call:chararray,digis:chararray,gtype:chararray,gate:chararray,info:chararray,firsthop:chararray")
def aprs(l):
try:
return parse_aprs(l)
except:
return None

class Position:
"""
A canonical APRS position.
Expand Down

0 comments on commit aec0edb

Please sign in to comment.