Browse Source

checkpoint

Greg Albrecht 2 years ago
parent
commit
da54764cd1

+ 1 - 1
COPYRIGHT.txt

@ -1 +1 @@
1
Copyright 2016 Orion Labs, Inc. and Contributors
1
Copyright 2017 Greg Albrecht and Contributors

+ 1 - 1
LICENSE

@ -1,4 +1,4 @@
1
Copyright 2016 Orion Labs, Inc. and Contributors
1
Copyright 2017 Greg Albrecht and Contributors
2 2
3 3
Licensed under the Apache License, Version 2.0 (the "License");
4 4
you may not use this file except in compliance with the License.

+ 1 - 1
Makefile

@ -2,7 +2,7 @@
2 2
#
3 3
# Source:: https://github.com/ampledata/kiss
4 4
# Author:: Greg Albrecht W2GMD <oss@undef.net>
5
# Copyright:: Copyright 2016 Orion Labs, Inc. and Contributors
5
# Copyright:: Copyright 2017 Greg Albrecht and Contributors
6 6
# License:: Apache License, Version 2.0
7 7
#
8 8

+ 1 - 1
README.rst

@ -80,7 +80,7 @@ http://ampledata.org/
80 80
81 81
Copyright
82 82
=========
83
Copyright 2016 Orion Labs, Inc. and Contributors
83
Copyright 2017 Greg Albrecht and Contributors
84 84
85 85
`Automatic Packet Reporting System (APRS) <http://www.aprs.org/>`_ is Copyright Bob Bruninga WB4APR wb4apr@amsat.org
86 86

+ 1 - 1
examples/serial_read.py

@ -33,7 +33,7 @@ import kiss
33 33
34 34
35 35
def print_frame(frame):
36
    print(aprs.Frame(frame))
36
    print((aprs.Frame(frame)))
37 37
38 38
39 39
def main():

+ 152 - 2
examples/socket_read.py

@ -34,9 +34,157 @@ import aprs
34 34
import kiss
35 35
36 36
37
def print_frame(frame):
38
    print(aprs.Frame(frame))
37
def main2():
38
39
    frame = kiss.strip_df_start(x)
40
41
    for frame_slice in range(0, frame_len):
42
        # Is address field length correct?
43
        # Find the first ODD Byte followed by the next boundary:
44
        if (frame[frame_slice] & 0x01 and ((frame_slice + 1) % 7) == 0):
45
            i = int((frame_slice + 1) / 7)
46
47
            # Less than 2 callsigns?
48
            if 1 < i < 11:
49
                # For frames <= 70 bytes
50
                if frame_len >= frame_slice + 2:
51
                    if (frame[frame_slice + 1] & 0x03 == 0x03 and
52
                            frame[frame_slice + 2] in
53
                            [0xF0, 0xCF]):
54
55
                        text = frame[frame_slice + 3:]
56
                        print("Text=%s" % text)
57
58
                        dest = aprs.Callsign(frame)
59
                        dest2 = aprs.Callsign2(frame, True)
60
                        print(dest)
61
                        print(dest2.callsign)
62
63
                        src = aprs.Callsign(frame[7:])
64
                        src2 = aprs.Callsign2(frame[7:], True)
65
                        print(src)
66
                        print(src2.callsign)
67
                        path = []
68
                        for x in range(2, 1):
69
                            path_call = aprs.Callsign(frame[x * 7:])
70
71
                            if path_call:
72
                                if frame[x * 7 + 6] & 0x80:
73
                                    path_call.digi = True
74
75
                            path.append(path_call)
76
                        print(path)
77
78
def test():
79
    # http://www.tapr.org/pdf/AX25.2.2.pdf
80
    import binascii
81
    import struct
82
    x =                                     b'\x00\xA8\x8A\xA6\xA8@@\xe0\xAE\x84d\x9e\xA6\xb4\xFF\x03\xF0,The quick brown fox jumps over the lazy dog!  0218 of 1000'
83
    y =         b'\x82\xA0\xA4\xA6@@`\x88\xAA\x9A\x9A\xB2@`\xAE\x92\x88\x8AB@b\xAE\x92\x88\x8AD@c\x03\xF0,The quick brown fox jumps over the lazy dog!  0218 of 1000'
84
    bs_header = b'\x82\xA0\xA4\xA6@@`\x88\xAA\x9A\x9A\xB2@`\xAE\x92\x88\x8AB@b\xAE\x92\x88\x8AD@c\x03\xF0'
85
    bs_packet = b'\x82\xA0\xA4\xA6@@`\x88\xAA\x9A\x9A\xB2@`\xAE\x92\x88\x8AB@b\xAE\x92\x88\x8AD@c\x03\xF0:Test\xF5G'
86
    expected_bytes = b'\x82\xa0\xa4\xa6@@`\x88\xaa\x9a\x9a\xb2@`\xae\x92\x88\x8ab@b\xae\x92\x88\x8ad@c\x03\xf0:Test\x9f/\xfb\x01'
87
88
    z = b'\x98\x94\x6E\xA0'
89
90
import binascii
91
92
def print_frame2(f):
93
    r = f[1:]
94
    print("Raw Frame={}".format(r))
95
    print("Hex Frame={}".format(binascii.hexlify(r)))
96
97
    encoded_destination = r[:7]
98
    print("       Len Dest={}".format(len(encoded_destination)))
99
    print("   Encoded Dest={}".format(encoded_destination))
100
    decoded_destination = decode_callsign(encoded_destination)
101
    print("   Decoded Dest={}".format(decoded_destination))
102
    reencoded_destination = encode_callsign2(decoded_destination)
103
    print("     2 Len Dest={}".format(len(reencoded_destination)))
104
105
    print("Re-Encoded Dest={}".format(reencoded_destination))
106
    redecoded_destination = decode_callsign(reencoded_destination)
107
    print("Re-Decoded Dest={}".format(redecoded_destination))
108
    print()
109
    assert(reencoded_destination == encoded_destination)
110
    assert(redecoded_destination == decoded_destination)
111
112
    encoded_source = r[7:14]
113
    print("       Len Source={}".format(len(encoded_source)))
114
    print("   Encoded Source={}".format(encoded_source))
115
    decoded_source = decode_callsign(encoded_source)
116
    print("   Decoded Source={}".format(decoded_source))
117
    reencoded_source = encode_callsign2(decoded_source)
118
    print("Re-Encoded Source={}".format(reencoded_source))
119
    redecoded_source = decode_callsign(reencoded_source)
120
    print("Re-Decoded Source={}".format(redecoded_source))
121
    print()
122
    assert(reencoded_source == encoded_source)
123
    assert(redecoded_source == decoded_source)
124
125
126
def encode_callsign1(full_callsign):
127
    encoded_callsign = b''
128
    ssid = '0'
129
130
    if '-' in full_callsign:
131
        full_callsign, ssid = full_callsign.split('-')
132
133
    full_callsign = "%-6s" % full_callsign
134
135
    for char in full_callsign:
136
        encoded_char = ord(char) << 1
137
        encoded_callsign += bytes([encoded_char])
138
139
    encoded_ssid = (int(ssid) << 1) | 0x60
140
    encoded_callsign += bytes([encoded_ssid])
141
142
    return encoded_callsign
143
144
145
def decode_callsign(encoded_callsign):
146
    assert(len(encoded_callsign) == 7)
147
    callsign = ''
148
    # To determine the encoded SSID:
149
    # 1. Right-shift (or un-left-shift) the SSID bit [-1].
150
    # 2. mod15 the bit (max SSID of 15).
151
    #
152
    ssid = str((encoded_callsign[-1] >> 1) & 15) # aka 0x0F
153
    for char in encoded_callsign[:-1]:
154
        callsign += chr(char >> 1)
155
    if ssid == '0':
156
        return callsign.strip()
157
    else:
158
        return '-'.join([callsign.strip(), ssid])
159
160
161
def encode_callsign2(callsign):
162
    callsign = callsign.upper()
163
    ssid = '0'
164
    encoded_callsign = b''
165
166
    if '-' in callsign:
167
        callsign, ssid = callsign.split('-')
168
169
    if 10 <= int(ssid) <= 15:
170
        # We have to call ord() on ssid here because we're receiving ssid as
171
        # a str() not bytes().
172
        ssid = chr(ord(ssid[1]) + 10)
173
        # chr(int('15') + 10)
174
175
    assert(len(ssid) == 1)
176
    assert(len(callsign) <= 6)
177
178
    callsign = "{callsign:6s}{ssid}".format(callsign=callsign, ssid=ssid)
179
180
    for char in callsign:
181
        encoded_char = ord(char) << 1
182
        encoded_callsign += bytes([encoded_char])
183
    return encoded_callsign
184
39 185
186
def print_frame(frame):
187
    print(aprs.Frame(frame[1:]))
40 188
41 189
def main():
42 190
    ki = kiss.TCPKISS(host='localhost', port=8001)
@ -44,5 +192,7 @@ def main():
44 192
    ki.read(callback=print_frame)
45 193
46 194
195
196
47 197
if __name__ == '__main__':
48 198
    main()

+ 3 - 3
kiss/__init__.py

@ -9,7 +9,7 @@ Python KISS Module.
9 9
10 10
11 11
:author: Greg Albrecht W2GMD <oss@undef.net>
12
:copyright: Copyright 2016 Orion Labs, Inc. and Contributors
12
:copyright: Copyright 2017 Greg Albrecht and Contributors
13 13
:license: Apache License, Version 2.0
14 14
:source: <https://github.com/ampledata/kiss>
15 15
@ -21,7 +21,7 @@ from .constants import (LOG_FORMAT, LOG_LEVEL, SERIAL_TIMEOUT, READ_BYTES,  # NO
21 21
                        FULL_DUPLEX, SET_HARDWARE, RETURN, DATAFRAME, TXDELAY,
22 22
                        P, SLOTTIME, TXTAIL, FULLDUPLEX, SETHARDWARE,
23 23
                        DEFAULT_KISS_CONFIG_VALUES, KISS_ON, KISS_OFF,
24
                        NMEA_HEADER)
24
                        NMEA_HEADER, UI_PROTOCOL_ID)
25 25
26 26
from .exceptions import SocketClosetError  # NOQA
27 27
@ -32,5 +32,5 @@ from .classes import KISS, TCPKISS, SerialKISS  # NOQA
32 32
33 33
34 34
__author__ = 'Greg Albrecht W2GMD <oss@undef.net>'
35
__copyright__ = 'Copyright 2016 Orion Labs, Inc. and Contributors'
35
__copyright__ = 'Copyright 2017 Greg Albrecht and Contributors'
36 36
__license__ = 'Apache License, Version 2.0'

+ 43 - 32
kiss/classes.py

@ -11,7 +11,7 @@ import serial
11 11
import kiss
12 12
13 13
__author__ = 'Greg Albrecht W2GMD <oss@undef.net>'
14
__copyright__ = 'Copyright 2016 Orion Labs, Inc. and Contributors'
14
__copyright__ = 'Copyright 2017 Greg Albrecht and Contributors'
15 15
__license__ = 'Apache License, Version 2.0'
16 16
17 17
@ -102,7 +102,7 @@ class KISS(object):
102 102
            'read_bytes=%s callback="%s" readmode=%s',
103 103
            read_bytes, callback, readmode)
104 104
105
        read_buffer = ''
105
        read_buffer = b''
106 106
107 107
        while 1:
108 108
            read_data = self._read_handler(read_bytes)
@ -114,9 +114,10 @@ class KISS(object):
114 114
                frames = []
115 115
116 116
                split_data = read_data.split(kiss.FEND)
117
                len_fend = len(split_data)
117
                fends = len(split_data)
118
118 119
                self._logger.debug(
119
                    'split_data(len_fend=%s)="%s"', len_fend, split_data)
120
                    'split_data(fends=%s)="%s"', fends, split_data)
120 121
121 122
                # Handle NMEAPASS on T3-Micro
122 123
                if len(read_data) >= 900:
@ -127,42 +128,47 @@ class KISS(object):
127 128
                            return [read_data]
128 129
129 130
                # No FEND in frame
130
                if len_fend == 1:
131
                    read_buffer = ''.join([read_buffer, split_data[0]])
131
                if fends == 1:
132
                    read_buffer = b''.join([read_buffer, split_data[0]])
132 133
                # Single FEND in frame
133
                elif len_fend == 2:
134
                elif fends == 2:
134 135
                    # Closing FEND found
135 136
                    if split_data[0]:
136 137
                        # Partial frame continued, otherwise drop
137
                        frames.append(''.join([read_buffer, split_data[0]]))
138
                        read_buffer = ''
138
                        frames.append(b''.join([read_buffer, split_data[0]]))
139
                        read_buffer = b''
139 140
                    # Opening FEND found
140 141
                    else:
141 142
                        frames.append(read_buffer)
142 143
                        read_buffer = split_data[1]
143
                # At least one complete frame received
144
                elif len_fend >= 3:
144
145
                # At least one complete frame received: [FEND, xxx, FEND]
146
                elif fends >= 3:
147
145 148
                    # Iterate through split_data and extract just the frames.
146
                    for i in range(0, len_fend - 1):
147
                        _str = ''.join([read_buffer, split_data[i]])
148
                        self._logger.debug('i=%s _str="%s"', i, _str)
149
                        if _str:
150
                            frames.append(_str)
151
                            read_buffer = ''
152
                    if split_data[len_fend - 1]:
153
                        read_buffer = split_data[len_fend - 1]
149
                    for i in range(0, fends - 1):
150
                        buf = b''.join([read_buffer, split_data[i]])
151
                        self._logger.debug('i=%s buf="%s"', i, buf)
152
                        if buf:
153
                            self._logger.debug('Frame Found: "%s"', buf)
154
                            frames.append(buf)
155
                            read_buffer = b''
156
157
                    # TODO: What do I do?
158
                    if split_data[fends - 1]:
159
                        self._logger.debug('Mystery Conditional')
160
                        read_buffer = split_data[fends - 1]
154 161
155 162
                # Fixup T3-Micro NMEA Sentences
156
                frames = map(kiss.strip_nmea, frames)
157
163
                frames = list(map(kiss.strip_nmea, frames))
158 164
                # Remove None frames.
159
                frames = filter(None, frames)
165
                frames = [_f for _f in frames if _f]
160 166
161 167
                # Maybe.
162
                frames = map(kiss.recover_special_codes, frames)
168
                frames = list(map(kiss.recover_special_codes, frames))
163 169
164 170
                if self.strip_df_start:
165
                    frames = map(kiss.strip_df_start, frames)
171
                    frames = list(map(kiss.strip_df_start, frames))
166 172
167 173
                if readmode:
168 174
                    for frame in frames:
@ -207,8 +213,6 @@ class TCPKISS(KISS):
207 213
        read_bytes = read_bytes or kiss.READ_BYTES
208 214
        read_data = self.interface.recv(read_bytes)
209 215
        self._logger.debug('len(read_data)=%s', len(read_data))
210
        if read_data == '':
211
            raise kiss.SocketClosetError('Socket Closed')
212 216
        return read_data
213 217
214 218
    def stop(self):
@ -222,6 +226,7 @@ class TCPKISS(KISS):
222 226
        self.interface = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
223 227
        self._logger.debug('Conntecting to %s', self.address)
224 228
        self.interface.connect(self.address)
229
        self._logger.info('Connected to %s', self.address)
225 230
        self._write_handler = self.interface.send
226 231
227 232
@ -238,12 +243,10 @@ class SerialKISS(KISS):
238 243
    def _read_handler(self, read_bytes=None):
239 244
        read_bytes = read_bytes or kiss.READ_BYTES
240 245
        read_data = self.interface.read(read_bytes)
241
        if len(read_data):
242
            self._logger.debug(
243
                'read_data(%s)="%s"', len(read_data), read_data)
244
        waiting_data = self.interface.inWaiting()
246
        self._logger.debug('len(read_data)=%s', len(read_data))
247
        waiting_data = self.interface.in_waiting
245 248
        if waiting_data:
246
            self._logger.debug('waiting_data="%s"', waiting_data)
249
            self._logger.debug('len(waiting_data)=%s', len(waiting_data))
247 250
            read_data = ''.join([
248 251
                read_data, self.interface.read(waiting_data)])
249 252
        return read_data
@ -255,7 +258,7 @@ class SerialKISS(KISS):
255 258
256 259
        Use `config_xastir()` for Xastir defaults.
257 260
        """
258
        return [self.write_setting(k, v) for k, v in kwargs.items()]
261
        return [self.write_setting(k, v) for k, v in list(kwargs.items())]
259 262
260 263
    def config_xastir(self):
261 264
        """
@ -291,3 +294,11 @@ class SerialKISS(KISS):
291 294
        self.interface.timeout = kiss.SERIAL_TIMEOUT
292 295
        self._write_handler = self.interface.write
293 296
        self._write_defaults(**kwargs)
297
298
    def start_no_config(self):
299
        """
300
        Initializes the KISS device without writing configuration.
301
        """
302
        self.interface = serial.Serial(self.port, self.speed)
303
        self.interface.timeout = kiss.SERIAL_TIMEOUT
304
        self._write_handler = self.interface.write

+ 25 - 18
kiss/constants.py

@ -4,13 +4,18 @@
4 4
"""Python KISS Module Constants."""
5 5
6 6
import logging
7
import os
7 8
8 9
__author__ = 'Greg Albrecht W2GMD <oss@undef.net>'
9
__copyright__ = 'Copyright 2016 Orion Labs, Inc. and Contributors'
10
__copyright__ = 'Copyright 2017 Greg Albrecht and Contributors'
10 11
__license__ = 'Apache License, Version 2.0'
11 12
12 13
13
LOG_LEVEL = logging.DEBUG
14
if bool(os.environ.get('DEBUG_KISS')) or bool(os.environ.get('DEBUG_ALL')):
15
    LOG_LEVEL = logging.DEBUG
16
else:
17
    LOG_LEVEL = logging.INFO
18
14 19
LOG_FORMAT = logging.Formatter(
15 20
    '%(asctime)s kiss %(levelname)s %(name)s.%(funcName)s:%(lineno)d'
16 21
    ' - %(message)s')
@ -22,35 +27,35 @@ READ_BYTES = 1000
22 27
# http://en.wikipedia.org/wiki/KISS_(TNC)#Special_Characters
23 28
# http://k4kpk.com/content/notes-aprs-kiss-and-setting-tnc-x-igate-and-digipeater
24 29
# Frames begin and end with a FEND/Frame End/0xC0 byte
25
FEND = chr(0xC0)  # Marks START and END of a Frame
26
FESC = chr(0xDB)  # Escapes FEND and FESC bytes within a frame
30
FEND = b'\xC0'  # Marks START and END of a Frame
31
FESC = b'\xDB'  # Escapes FEND and FESC bytes within a frame
27 32
28 33
# Transpose Bytes: Used within a frame-
29 34
# "Transpose FEND": An FEND after an FESC (within a frame)-
30 35
# Sent as FESC TFEND
31
TFEND = chr(0xDC)
36
TFEND = b'\xDC'
32 37
# "Transpose FESC": An FESC after an FESC (within a frame)-
33 38
# Sent as FESC TFESC
34
TFESC = chr(0xDD)
39
TFESC = b'\xDD'
35 40
36 41
# "FEND is sent as FESC, TFEND"
37 42
# 0xC0 is sent as 0xDB 0xDC
38
FESC_TFEND = ''.join([FESC, TFEND])
43
FESC_TFEND = b''.join([FESC, TFEND])
39 44
40 45
# "FESC is sent as FESC, TFESC"
41 46
# 0xDB is sent as 0xDB 0xDD
42
FESC_TFESC = ''.join([FESC, TFESC])
47
FESC_TFESC = b''.join([FESC, TFESC])
43 48
44 49
# KISS Command Codes
45 50
# http://en.wikipedia.org/wiki/KISS_(TNC)#Command_Codes
46
DATA_FRAME = chr(0x00)
47
TX_DELAY = chr(0x01)
48
PERSISTENCE = chr(0x02)
49
SLOT_TIME = chr(0x03)
50
TX_TAIL = chr(0x04)
51
FULL_DUPLEX = chr(0x05)
52
SET_HARDWARE = chr(0x06)
53
RETURN = chr(0xFF)
51
DATA_FRAME = b'\x00'
52
TX_DELAY = b'\x01'
53
PERSISTENCE = b'\x02'
54
SLOT_TIME = b'\x03'
55
TX_TAIL = b'\x04'
56
FULL_DUPLEX = b'\x05'
57
SET_HARDWARE = b'\x06'
58
RETURN = b'\xFF'
54 59
55 60
# Alternate convenience spellings for Command Codes
56 61
# (these more closely match the names in the spec)
@ -71,6 +76,8 @@ DEFAULT_KISS_CONFIG_VALUES = {
71 76
}
72 77
73 78
KISS_ON = 'KISS $0B'
74
KISS_OFF = ''.join([FEND, chr(0xFF), FEND, FEND])
79
KISS_OFF = b''.join([FEND, RETURN, FEND, FEND])
80
81
NMEA_HEADER = b''.join([FEND, b'\xF0', b'$'])
75 82
76
NMEA_HEADER = ''.join([FEND, chr(0xF0), '$'])
83
UI_PROTOCOL_ID = b'\xF0'

+ 1 - 1
kiss/exceptions.py

@ -4,7 +4,7 @@
4 4
"""Python KISS Module Exception Definitions."""
5 5
6 6
__author__ = 'Greg Albrecht W2GMD <oss@undef.net>'
7
__copyright__ = 'Copyright 2016 Orion Labs, Inc. and Contributors'
7
__copyright__ = 'Copyright 2017 Greg Albrecht and Contributors'
8 8
__license__ = 'Apache License, Version 2.0'
9 9
10 10

+ 4 - 4
kiss/util.py

@ -6,7 +6,7 @@
6 6
import kiss
7 7
8 8
__author__ = 'Greg Albrecht W2GMD <oss@undef.net>'
9
__copyright__ = 'Copyright 2016 Orion Labs, Inc. and Contributors'
9
__copyright__ = 'Copyright 2017 Greg Albrecht and Contributors'
10 10
__license__ = 'Apache License, Version 2.0'
11 11
12 12
@ -57,8 +57,8 @@ def extract_ui(frame):
57 57
    """
58 58
    start_ui = frame.split(
59 59
        ''.join([kiss.FEND, kiss.DATA_FRAME]))
60
    end_ui = start_ui[0].split(''.join([kiss.SLOT_TIME, chr(0xF0)]))
61
    return ''.join([chr(ord(x) >> 1) for x in end_ui[0]])
60
    end_ui = start_ui[0].split(b''.join([kiss.SLOT_TIME, kiss.UI_PROTOCOL_ID]))
61
    return b''.join([chr(ord(x) >> 1) for x in end_ui[0]])
62 62
63 63
64 64
def strip_df_start(frame):
@ -78,6 +78,6 @@ def strip_nmea(frame):
78 78
    Extracts NMEA header from T3-Micro or NMEA encoded KISS frames.
79 79
    """
80 80
    if len(frame) > 0:
81
        if ord(frame[0]) == 240:
81
        if frame[0] == 240:
82 82
            return frame[1:].rstrip()
83 83
    return frame

+ 1 - 1
requirements.txt

@ -2,7 +2,7 @@
2 2
#
3 3
# Source:: https://github.com/ampledata/kiss
4 4
# Author:: Greg Albrecht W2GMD <oss@undef.net>
5
# Copyright:: Copyright 2016 Orion Labs, Inc. and Contributors
5
# Copyright:: Copyright 2017 Greg Albrecht and Contributors
6 6
# License:: Apache License, Version 2.0
7 7
8 8

+ 1 - 1
setup.cfg

@ -2,7 +2,7 @@
2 2
#
3 3
# Source:: https://github.com/ampledata/kiss
4 4
# Author:: Greg Albrecht W2GMD <oss@undef.net>
5
# Copyright:: Copyright 2016 Orion Labs, Inc. and Contributors
5
# Copyright:: Copyright 2017 Greg Albrecht and Contributors
6 6
# License:: Apache License, Version 2.0
7 7
#
8 8

+ 3 - 3
setup.py

@ -12,9 +12,9 @@ import setuptools
12 12
import sys
13 13
14 14
__title__ = 'kiss'
15
__version__ = '6.0.1'
15
__version__ = '7.0.0b1'
16 16
__author__ = 'Greg Albrecht W2GMD <oss@undef.net>'
17
__copyright__ = 'Copyright 2016 Orion Labs, Inc. and Contributors'
17
__copyright__ = 'Copyright 2017 Greg Albrecht and Contributors'
18 18
__license__ = 'Apache License, Version 2.0'
19 19
20 20
@ -47,7 +47,7 @@ setuptools.setup(
47 47
        'nose >= 1.3.7',
48 48
        'dummyserial'
49 49
    ],
50
    install_requires=['pyserial >= 2.7'],
50
    install_requires=['pyserial >= 3.0'],
51 51
    classifiers=[
52 52
        'Topic :: Communications :: Ham Radio',
53 53
        'Programming Language :: Python',

+ 1 - 1
tests/constants.py

@ -4,7 +4,7 @@
4 4
"""Constants for KISS Module Tests."""
5 5
6 6
__author__ = 'Greg Albrecht W2GMD <oss@undef.net>'
7
__copyright__ = 'Copyright 2016 Orion Labs, Inc. and Contributors'
7
__copyright__ = 'Copyright 2017 Greg Albrecht and Contributors'
8 8
__license__ = 'Apache License, Version 2.0'
9 9
10 10

+ 1 - 1
tests/context.py

@ -12,5 +12,5 @@ import kiss  # NOQA pylint: disable=W0611
12 12
import kiss.constants  # NOQA pylint: disable=W0611
13 13
14 14
__author__ = 'Greg Albrecht W2GMD <oss@undef.net>'
15
__copyright__ = 'Copyright 2016 Orion Labs, Inc. and Contributors'
15
__copyright__ = 'Copyright 2017 Greg Albrecht and Contributors'
16 16
__license__ = 'Apache License, Version 2.0'

+ 1 - 1
tests/test_kiss_util.py

@ -4,7 +4,7 @@
4 4
"""Tests for KISS Util Module."""
5 5
6 6
__author__ = 'Greg Albrecht W2GMD <oss@undef.net>'
7
__copyright__ = 'Copyright 2016 Orion Labs, Inc. and Contributors'
7
__copyright__ = 'Copyright 2017 Greg Albrecht and Contributors'
8 8
__license__ = 'Apache License, Version 2.0'
9 9
10 10

+ 3 - 3
tests/test_serialkiss.py

@ -4,7 +4,7 @@
4 4
"""Tests for KISS Classes."""
5 5
6 6
__author__ = 'Greg Albrecht W2GMD <oss@undef.net>'
7
__copyright__ = 'Copyright 2016 Orion Labs, Inc. and Contributors'
7
__copyright__ = 'Copyright 2017 Greg Albrecht and Contributors'
8 8
__license__ = 'Apache License, Version 2.0'
9 9
10 10
@ -59,11 +59,11 @@ class SerialKISSTestCase(unittest.TestCase):
59 59
        :type alphabet: str
60 60
        """
61 61
        alphabet = alphabet or constants.ALPHANUM
62
        return ''.join(random.choice(alphabet) for _ in xrange(length))
62
        return ''.join(random.choice(alphabet) for _ in range(length))
63 63
64 64
    @classmethod
65 65
    def print_frame(cls, frame):
66
        print(aprs.Frame(frame))
66
        print((aprs.Frame(frame)))
67 67
68 68
    def test_write(self):
69 69
        ks = kiss.SerialKISS(port=self.random_serial_port, speed='9600')

+ 3 - 3
tests/test_tcpkiss.py

@ -4,7 +4,7 @@
4 4
"""Tests for TCPKISS Class."""
5 5
6 6
__author__ = 'Greg Albrecht W2GMD <oss@undef.net>'
7
__copyright__ = 'Copyright 2016 Orion Labs, Inc. and Contributors'
7
__copyright__ = 'Copyright 2017 Greg Albrecht and Contributors'
8 8
__license__ = 'Apache License, Version 2.0'
9 9
10 10
@ -62,11 +62,11 @@ class TCPKISSTestCase(unittest.TestCase):
62 62
        :type alphabet: str
63 63
        """
64 64
        alphabet = alphabet or constants.ALPHANUM
65
        return ''.join(random.choice(alphabet) for _ in xrange(length))
65
        return ''.join(random.choice(alphabet) for _ in range(length))
66 66
67 67
    @classmethod
68 68
    def print_frame(cls, frame):
69
        print(aprs.Frame(frame))
69
        print((aprs.Frame(frame)))
70 70
71 71
    @mocketize
72 72
    def _test_write(self):