Added basic header with license

Renamed main class to micropyGPS
Remove unused struct import
Added to class doc string
pull/4/head
Calvin 2014-12-10 18:13:50 -05:00
rodzic cb464a8b08
commit 0d16f0f26f
1 zmienionych plików z 24 dodań i 4 usunięć

Wyświetl plik

@ -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: