diff options
author | Jeff Widman <jeff@jeffwidman.com> | 2017-02-09 12:27:16 -0800 |
---|---|---|
committer | Dana Powers <dana.powers@gmail.com> | 2017-02-09 12:27:16 -0800 |
commit | 8fde79dbb5a3793b1a9ebd10e032d5f3dd535645 (patch) | |
tree | a991daae07aa142d936b37a2af7f55030355357b /kafka/protocol/message.py | |
parent | e825483d49bda41f13420311cbc9ffd59f7cee3d (diff) | |
download | kafka-python-8fde79dbb5a3793b1a9ebd10e032d5f3dd535645.tar.gz |
PEP-8: Spacing & removed unused imports (#899)
Diffstat (limited to 'kafka/protocol/message.py')
-rw-r--r-- | kafka/protocol/message.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/kafka/protocol/message.py b/kafka/protocol/message.py index 36f03ca..bfad127 100644 --- a/kafka/protocol/message.py +++ b/kafka/protocol/message.py @@ -6,7 +6,6 @@ import time from ..codec import (has_gzip, has_snappy, has_lz4, gzip_decode, snappy_decode, lz4_decode, lz4_decode_old_kafka) -from . import pickle from .struct import Struct from .types import ( Int8, Int32, Int64, Bytes, Schema, AbstractType @@ -36,7 +35,7 @@ class Message(Struct): CODEC_SNAPPY = 0x02 CODEC_LZ4 = 0x03 TIMESTAMP_TYPE_MASK = 0x08 - HEADER_SIZE = 22 # crc(4), magic(1), attributes(1), timestamp(8), key+value size(4*2) + HEADER_SIZE = 22 # crc(4), magic(1), attributes(1), timestamp(8), key+value size(4*2) def __init__(self, value, key=None, magic=0, attributes=0, crc=0, timestamp=None): @@ -127,7 +126,7 @@ class Message(Struct): else: raw_bytes = lz4_decode(self.value) else: - raise Exception('This should be impossible') + raise Exception('This should be impossible') return MessageSet.decode(raw_bytes, bytes_to_read=len(raw_bytes)) @@ -145,7 +144,7 @@ class MessageSet(AbstractType): ('offset', Int64), ('message', Bytes) ) - HEADER_SIZE = 12 # offset + message_size + HEADER_SIZE = 12 # offset + message_size @classmethod def encode(cls, items): |