From f3d8311ac24943ce3d8eabd353097a8945ab405c Mon Sep 17 00:00:00 2001 From: Nigel Dokter Date: Wed, 11 Jan 2017 17:40:25 +0100 Subject: [PATCH] updated readme and changelog for upcoming breaking API changes; skip pylama check for unused imports in clients module; --- CHANGELOG.rst | 10 ++++++++++ README.rst | 2 +- dsmr_parser/clients/protocol.py | 2 +- dsmr_parser/clients/serial_.py | 3 --- tox.ini | 3 +++ 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5f28f0c..310379e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,16 @@ Change Log ---------- +**0.7** (2017-01-14) + +- Internal refactoring related to the way clients feed their data into the parse module. Clients can now supply the telegram data in single characters, lines (which was common) or complete telegram strings. + +**IMPORTANT: this release has the following backwards incompatible changes:** + +- Client related imports from dsmr_parser.serial and dsmr_parser.protocol have been moved to dsmr_parser.clients (import these from the clients/__init__.py module) +- The .parse() method of TelegramParser, TelegramParserV2_2, TelegramParserV4 now accepts a string containing the entire telegram (including \r\n characters) and not a list + + **0.6** (2017-01-04) - Fixed bug in CRC checksum verification for the asyncio client (`pull request #15 `_) diff --git a/README.rst b/README.rst index ca62ede..b2136fd 100644 --- a/README.rst +++ b/README.rst @@ -26,7 +26,7 @@ Using the serial reader to connect to your smart meter and parse it's telegrams: from dsmr_parser import telegram_specifications from dsmr_parser import obis_references - from dsmr_parser.serial import SerialReader, SERIAL_SETTINGS_V4 + from dsmr_parser.clients import SerialReader, SERIAL_SETTINGS_V4 serial_reader = SerialReader( device='/dev/ttyUSB0', diff --git a/dsmr_parser/clients/protocol.py b/dsmr_parser/clients/protocol.py index 26ff573..87293d8 100644 --- a/dsmr_parser/clients/protocol.py +++ b/dsmr_parser/clients/protocol.py @@ -1,8 +1,8 @@ """Asyncio protocol implementation for handling telegrams.""" +from functools import partial import asyncio import logging -from functools import partial from serial_asyncio import create_serial_connection diff --git a/dsmr_parser/clients/serial_.py b/dsmr_parser/clients/serial_.py index f5fa6a9..e9f9221 100644 --- a/dsmr_parser/clients/serial_.py +++ b/dsmr_parser/clients/serial_.py @@ -84,6 +84,3 @@ class AsyncSerialReader(SerialReader): ) except ParseError as e: logger.warning('Failed to parse telegram: %s', e) - - - diff --git a/tox.ini b/tox.ini index 39ff113..1402405 100644 --- a/tox.ini +++ b/tox.ini @@ -14,6 +14,9 @@ commands= py.test --cov=dsmr_parser test {posargs} pylama dsmr_parser test +[pylama:dsmr_parser/clients/__init__.py] +ignore = W0611 + [pylama:pylint] max_line_length = 100