Skip to content

Commit

Permalink
Merge pull request #33 from semuconsulting/RC-1.0.4
Browse files Browse the repository at this point in the history
RC 1.0.4
  • Loading branch information
semuadmin authored Oct 11, 2024
2 parents 7a9caba + 9c3e7c6 commit 1279010
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"python3.8InterpreterPath": "/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8",
"modulename": "${workspaceFolderBasename}",
"distname": "${workspaceFolderBasename}",
"moduleversion": "1.0.3"
"moduleversion": "1.0.4"
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class pyspartn.spartnreader.SPARTNReader(stream, **kwargs)

You can create a `SPARTNReader` object by calling the constructor with an active stream object.
The stream object can be any data stream which supports a `read(n) -> bytes` method (e.g. File or Serial, with
or without a buffer wrapper). `pyspartn` implements an internal `SocketStream` class to allow sockets to be read in the same way as other streams.
or without a buffer wrapper). `pyspartn` implements an internal `SocketWrapper` class to allow sockets to be read in the same way as other streams.

Individual SPARTN messages can then be read using the `SPARTNReader.read()` function, which returns both the raw binary data (as bytes) and the parsed data (as a `SPARTNMessage`, via the `parse()` method). The function is thread-safe in so far as the incoming data stream object is thread-safe. `SPARTNReader` also implements an iterator. See examples below.

Expand Down
8 changes: 8 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

### RELEASE 1.0.3

CHANGES:

1. Add active support for Python 3.13
1. Drop active support for Python 3.8 - now EOL as at October 2024.
1. Rename socket_stream to socket_wrapper for clarity.

### RELEASE 1.0.3

FIXES:

1. Add offsets to SF043, SF045 and SF048 - thanks to @jonathanmuller for contribution.
Expand Down
6 changes: 3 additions & 3 deletions docs/pyspartn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ pyspartn.exceptions module
:undoc-members:
:show-inheritance:

pyspartn.socket\_stream module
------------------------------
pyspartn.socket\_wrapper module
-------------------------------

.. automodule:: pyspartn.socket_stream
.. automodule:: pyspartn.socket_wrapper
:members:
:undoc-members:
:show-inheritance:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "pyspartn"
authors = [{ name = "semuadmin", email = "[email protected]" }]
maintainers = [{ name = "semuadmin", email = "[email protected]" }]
description = "SPARTN protocol parser"
version = "1.0.3"
version = "1.0.4"
license = { file = "LICENSE" }
readme = "README.md"
requires-python = ">=3.9"
Expand Down
2 changes: 1 addition & 1 deletion src/pyspartn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
SPARTNStreamError,
SPARTNTypeError,
)
from pyspartn.socket_stream import SocketStream
from pyspartn.socket_wrapper import SocketWrapper
from pyspartn.spartnhelpers import *
from pyspartn.spartnmessage import SPARTNMessage
from pyspartn.spartnreader import SPARTNReader
Expand Down
2 changes: 1 addition & 1 deletion src/pyspartn/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
:license: BSD 3-Clause
"""

__version__ = "1.0.3"
__version__ = "1.0.4"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
socket_stream class.
socket_wrapper.py
A skeleton socket wrapper which provides basic stream-like
read(bytes) and readline() methods.
Expand All @@ -19,7 +19,7 @@
from socket import socket


class SocketStream:
class SocketWrapper:
"""
socket stream class.
"""
Expand Down
4 changes: 2 additions & 2 deletions src/pyspartn/spartnreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
SPARTNStreamError,
SPARTNTypeError,
)
from pyspartn.socket_stream import SocketStream
from pyspartn.socket_wrapper import SocketWrapper
from pyspartn.spartnhelpers import bitsval, naive2aware, timetag2date, valid_crc
from pyspartn.spartnmessage import SPARTNMessage
from pyspartn.spartntables import ALN_ENUM
Expand Down Expand Up @@ -93,7 +93,7 @@ def __init__(
# pylint: disable=too-many-arguments

if isinstance(datastream, socket):
self._stream = SocketStream(datastream, bufsize=bufsize)
self._stream = SocketWrapper(datastream, bufsize=bufsize)
else:
self._stream = datastream
self.key = getenv("MQTTKEY", None) if key is None else key
Expand Down
2 changes: 1 addition & 1 deletion tests/test_socket.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Socket reader tests for pyspartn - uses dummy socket class
to achieve 99% test coverage of SocketStream.
to achieve 99% test coverage of SocketWrapper.
Created on 11 May 2022
Expand Down

0 comments on commit 1279010

Please sign in to comment.