Skip to content

Explain parse_private name #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions adafruit_bluefruit_connect/button_packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def __init__(self, button, pressed):
def parse_private(cls, packet):
"""Construct a ButtonPacket from an incoming packet.
Do not call this directly; call Packet.from_bytes() instead.
pylint makes it difficult to call this method _parse(), hence the name.
"""
button, pressed = struct.unpack(cls._FMT_PARSE, packet)
if not pressed in b'01':
Expand Down
1 change: 1 addition & 0 deletions adafruit_bluefruit_connect/color_packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def __init__(self, color):
def parse_private(cls, packet):
"""Construct a ColorPacket from an incoming packet.
Do not call this directly; call Packet.from_bytes() instead.
pylint makes it difficult to call this method _parse(), hence the name.
"""
return cls(struct.unpack(cls._FMT_PARSE, packet))

Expand Down
1 change: 1 addition & 0 deletions adafruit_bluefruit_connect/packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def parse_private(cls, packet):
is not correct.

Do not call this directly. It's called from ``cls.from_bytes()``.
pylint makes it difficult to call this method _parse(), hence the name.
"""
return cls(*struct.unpack(cls._FMT_PARSE, packet))

Expand Down