From 0d16f0f26f59ca98ad85f14b25a1b71b23b4d01c Mon Sep 17 00:00:00 2001 From: Calvin Date: Wed, 10 Dec 2014 18:13:50 -0500 Subject: [PATCH] Added basic header with license Renamed main class to micropyGPS Remove unused struct import Added to class doc string --- micropyGPS.py | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/micropyGPS.py b/micropyGPS.py index 734daab..ea550cd 100644 --- a/micropyGPS.py +++ b/micropyGPS.py @@ -1,4 +1,23 @@ -from struct import * +# MicropyGPS - a GPS NMEA sentence parser for Micropython/Python 3.X + +# +# The MIT License (MIT) + +# Copyright (c) 2014 Michael Calvin McCoy (calvin.mccoy@gmail.com) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +# documentation files (the “Software”), to deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit +# persons to whom the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + # TODO: # GSV Sentence @@ -23,8 +42,9 @@ test_GSV = ['$GPGSV,3,1,12,28,72,355,39,01,52,063,33,17,51,272,44,08,46,184,38*7 '$GPGSV,3,3,12,04,12,204,34,27,11,324,35,32,11,089,,26,10,264,40*7B'] -class MicroGPSpy(object): - """GPS NMEA Sentence Parser""" +class MicropyGPS(object): + """GPS NMEA Sentence Parser. Creates object that stores all relevant GPS data and statistics. + Parses sentences one character at a time using update(). """ def __init__(self, local_offset=0): """Setup GPS Object Status Flags, Internal Data Registers, etc""" @@ -359,7 +379,7 @@ class MicroGPSpy(object): if __name__ == "__main__": - my_gps = MicroGPSpy() + my_gps = MicropyGPS() sentence = '' for RMC_sentence in test_RMC: for y in RMC_sentence: