Browse Source

Style cleanup

Greg Albrecht 2 years ago
parent
commit
741082acef
4 changed files with 10 additions and 8 deletions
  1. 1 1
      kiss/__init__.py
  2. 4 4
      kiss/classes.py
  3. 2 3
      kiss/constants.py
  4. 3 0
      kiss/util.py

+ 1 - 1
kiss/__init__.py

@ -23,7 +23,7 @@ from .constants import (LOG_FORMAT, LOG_LEVEL, SERIAL_TIMEOUT, READ_BYTES,  # NO
23 23
                        DEFAULT_KISS_CONFIG_VALUES, KISS_ON, KISS_OFF,
24 24
                        NMEA_HEADER)
25 25
26
from .exceptions import SocketClosetError
26
from .exceptions import SocketClosetError  # NOQA
27 27
28 28
from .util import (escape_special_codes, recover_special_codes, extract_ui,  # NOQA
29 29
                   strip_df_start, strip_nmea)

+ 4 - 4
kiss/classes.py

@ -52,7 +52,6 @@ class KISS(object):
52 52
        Helper method to call when writing to KISS interface.
53 53
        """
54 54
        del frame
55
        pass
56 55
57 56
    def stop(self):
58 57
        """
@ -100,7 +99,8 @@ class KISS(object):
100 99
        :rtype: list
101 100
        """
102 101
        self._logger.debug(
103
            'read_bytes=%s callback="%s" readmode=%s', read_bytes, callback, readmode)
102
            'read_bytes=%s callback="%s" readmode=%s',
103
            read_bytes, callback, readmode)
104 104
105 105
        read_buffer = ''
106 106
@ -190,7 +190,7 @@ class KISS(object):
190 190
        self._logger.debug(
191 191
            'frame_kiss(%s)="%s"', len(frame_kiss), frame_kiss)
192 192
193
        frame_write = self._write_handler(frame_kiss)
193
        self._write_handler(frame_kiss)
194 194
195 195
196 196
class TCPKISS(KISS):
@ -242,7 +242,7 @@ class SerialKISS(KISS):
242 242
                'read_data(%s)="%s"', len(read_data), read_data)
243 243
        waiting_data = self.interface.inWaiting()
244 244
        if waiting_data:
245
            self._logger.debug('waiting_data="%s"',waiting_data)
245
            self._logger.debug('waiting_data="%s"', waiting_data)
246 246
            read_data = ''.join([
247 247
                read_data, self.interface.read(waiting_data)])
248 248
        return read_data

+ 2 - 3
kiss/constants.py

@ -3,14 +3,13 @@
3 3
4 4
"""Constants for KISS Python Module."""
5 5
6
import logging
7
6 8
__author__ = 'Greg Albrecht W2GMD <oss@undef.net>'
7 9
__copyright__ = 'Copyright 2016 Orion Labs, Inc. and Contributors'
8 10
__license__ = 'Apache License, Version 2.0'
9 11
10 12
11
import logging
12
13
14 13
LOG_LEVEL = logging.INFO
15 14
LOG_FORMAT = logging.Formatter(
16 15
    '%(asctime)s kiss %(levelname)s %(name)s.%(funcName)s:%(lineno)d'

+ 3 - 0
kiss/util.py

@ -74,6 +74,9 @@ def strip_df_start(frame):
74 74
75 75
76 76
def strip_nmea(frame):
77
    """
78
    Extracts NMEA header from T3-Micro or NMEA encoded KISS frames.
79
    """
77 80
    if ord(frame[0]) == 240:
78 81
        return frame[1:].rstrip()
79 82
    else: