rossengeorgiev / aprs-python

📡 Python module for working with APRS
http://aprs-python.readthedocs.io/en/latest/
GNU General Public License v2.0
118 stars 37 forks source link

Add function to clean WIDEn-N and * from path, leaving just digi callsigns #46

Open wsmitchell3 opened 6 years ago

wsmitchell3 commented 6 years ago

Added a function to turn a digi path list into a list of digis through which the packet passed. Path: ['K0ABC-1','WIDE1*','W0DEF-2','N0GHI-1*'] becomes digi path: ['K0ABC-1','W0DEF-2','N0GHI-1'] This is useful for anyone interested in getting just the digipeaters in the path without the extraneous routing info.

rossengeorgiev commented 6 years ago

Hi @wsmitchell3, thanks for the contribution, but I feel this doesn't need to part of the package. It can be reduced to single line path = list(filter(lambda x: not re.match(r'WIDE[0-9\-\*]+$', x), path)). I'm not sure how useful this could be in general, but it could be put under like aprslib.util module as helper function.