From 759e0a0d922521c4009937d01dce78aa5b383e12 Mon Sep 17 00:00:00 2001 From: Nigel Dokter Date: Mon, 9 Jan 2017 21:31:08 +0100 Subject: [PATCH] removed absolute imports back to relative due to serial.py importing from serial --- dsmr_parser/__main__.py | 2 +- dsmr_parser/parsers.py | 6 +++--- dsmr_parser/protocol.py | 9 ++++----- dsmr_parser/serial.py | 5 ++--- dsmr_parser/telegram_specifications.py | 6 +++--- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/dsmr_parser/__main__.py b/dsmr_parser/__main__.py index 03c9f1d..8813731 100644 --- a/dsmr_parser/__main__.py +++ b/dsmr_parser/__main__.py @@ -3,7 +3,7 @@ import asyncio import logging from functools import partial -from dsmr_parser.protocol import create_dsmr_reader, create_tcp_dsmr_reader +from .protocol import create_dsmr_reader, create_tcp_dsmr_reader def console(): diff --git a/dsmr_parser/parsers.py b/dsmr_parser/parsers.py index d36cdb6..a215a98 100644 --- a/dsmr_parser/parsers.py +++ b/dsmr_parser/parsers.py @@ -3,9 +3,9 @@ import re from PyCRC.CRC16 import CRC16 -from dsmr_parser.objects import MBusObject, MBusObjectV2_2, CosemObject -from dsmr_parser.exceptions import ParseError, InvalidChecksumError -from dsmr_parser.obis_references import GAS_METER_READING +from .objects import MBusObject, MBusObjectV2_2, CosemObject +from .exceptions import ParseError, InvalidChecksumError +from .obis_references import GAS_METER_READING logger = logging.getLogger(__name__) diff --git a/dsmr_parser/protocol.py b/dsmr_parser/protocol.py index 08a8732..24c3184 100644 --- a/dsmr_parser/protocol.py +++ b/dsmr_parser/protocol.py @@ -6,11 +6,10 @@ from functools import partial from serial_asyncio import create_serial_connection -from dsmr_parser import telegram_specifications -from dsmr_parser.exceptions import ParseError -from dsmr_parser.parsers import TelegramParserV2_2, TelegramParserV4 -from dsmr_parser.serial import (SERIAL_SETTINGS_V2_2, SERIAL_SETTINGS_V4, - TelegramBuffer) +from . import telegram_specifications +from .exceptions import ParseError +from .parsers import TelegramParserV2_2, TelegramParserV4 +from .serial import (SERIAL_SETTINGS_V2_2, SERIAL_SETTINGS_V4, TelegramBuffer) def create_dsmr_protocol(dsmr_version, telegram_callback, loop=None): diff --git a/dsmr_parser/serial.py b/dsmr_parser/serial.py index 93e31b9..da26308 100644 --- a/dsmr_parser/serial.py +++ b/dsmr_parser/serial.py @@ -4,9 +4,8 @@ import re import serial import serial_asyncio -from dsmr_parser.exceptions import ParseError -from dsmr_parser.parsers import TelegramParser, TelegramParserV2_2, \ - TelegramParserV4 +from .exceptions import ParseError +from .parsers import TelegramParser, TelegramParserV2_2, TelegramParserV4 logger = logging.getLogger(__name__) diff --git a/dsmr_parser/telegram_specifications.py b/dsmr_parser/telegram_specifications.py index adc5e62..958153b 100644 --- a/dsmr_parser/telegram_specifications.py +++ b/dsmr_parser/telegram_specifications.py @@ -1,8 +1,8 @@ from decimal import Decimal -from dsmr_parser import obis_references as obis -from dsmr_parser.parsers import CosemParser, ValueParser, MBusParser -from dsmr_parser.value_types import timestamp +from . import obis_references as obis +from .parsers import CosemParser, ValueParser, MBusParser +from .value_types import timestamp """