Skip to content

Commit

Permalink
Code reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
joergschultzelutter committed Sep 5, 2021
1 parent 1e045ee commit 9116853
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/AprsLibrary.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def connect_aprsis(self):
# Finally, connect to APRS-IS
self.ais.connect(blocking=True)

# Are we connected? If not, then properly destroy what we
# Are we connected? If not, then properly destroy what we
# may have gathered as data and raise an error
if not self.ais._connected:
disconnect_aprsis(self)
Expand Down Expand Up @@ -376,17 +376,15 @@ def send_aprs_packet(self, packet: str):
# Are we connected?
if not self.ais:
raise ConnectionError("Not connected to APRS-IS; cannot send packet")

# We seem to be connected
logger.debug(msg=f"Sending message '{packet}' to APRS-IS")

# Try to send data to the socket
try:
self.ais.sendall(packet)
except:
raise ConnectionError(
f"Error while sending message '{packet}' to APRS-IS"
)
raise ConnectionError(f"Error while sending message '{packet}' to APRS-IS")

@keyword("Receive APRS Packet")
def receive_aprs_packet(self, immortal: bool = True, raw: bool = False):
Expand Down Expand Up @@ -460,7 +458,7 @@ def get_msgno(self, aprs_packet):
)

# This is the core function which will extract the requested
# field name from our packet(s). The packet can either be in
# field name from our packet(s). The packet can either be in
# raw format (str or bytes) OR decoded. If you try to access
# a field that does not exist, this function will raise
# an exception. Use the "check ..." methods if you want to
Expand Down Expand Up @@ -549,8 +547,8 @@ def check_packet_msgno(self, aprs_packet):
)

# This is the core function which will check if a field exists
# in our packet(s). The packet can either be in
# raw format (str or bytes) OR decoded.
# in our packet(s). The packet can either be in
# raw format (str or bytes) OR decoded.
@keyword("APRS Message should contain")
def check_if_field_exists_in_packet(self, aprs_packet, field_name):
t_dict = type(dict())
Expand Down Expand Up @@ -594,4 +592,4 @@ def get_alphanumeric_counter_value(numeric_counter: int):


if __name__ == "__main__":
pass
pass

0 comments on commit 9116853

Please sign in to comment.