From 4a61e0ad044d5e9f91414e715720af24404ca50e Mon Sep 17 00:00:00 2001 From: Jun Jiang Date: Fri, 22 Nov 2024 11:17:56 +0100 Subject: [PATCH] Final, tested version Signed-off-by: Jun Jiang --- ebcmeasurements/__init__.py | 13 ++++++++----- setup.py | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ebcmeasurements/__init__.py b/ebcmeasurements/__init__.py index 65b8b7c..8805a45 100644 --- a/ebcmeasurements/__init__.py +++ b/ebcmeasurements/__init__.py @@ -6,12 +6,15 @@ try: from .Beckhoff import AdsDataSourceOutput -except (ImportError, FileNotFoundError) as e: - # If TwinCAT is not installed in system, it will cause an error as 'TcAdsDll.dll' does not exist. See: - # https://github.com/stlehmann/pyads/issues/105 - # https://stackoverflow.com/questions/76305160/windows-10-python-pyads-library-error-could-not-find-module-tcadsdll-dll +except FileNotFoundError as e: + # Without TwinCAT installed in system, 'FileNotFoundError' will be raised by Pyads due to missing 'TcAdsDll.dll'. + # Ref1: https://github.com/stlehmann/pyads/issues/105 + # Ref2: https://stackoverflow.com/questions/76305160/windows-10-python-pyads-library-error-could-not-find-module-tcadsdll-dll logging.warning( - f"TwinCAT not installed in the system, 'Beckhoff' submodule will not be available. Original error: {e}") + f"Without TwinCAT installed on the system, 'AdsDataSourceOutput' submodule will not be available. " + f"Original error: {e}") +except ImportError as e: + logging.error(f"Failed to import 'AdsDataSourceOutput': {e}") # Configure the root logger with a default leve and format logging.basicConfig( diff --git a/setup.py b/setup.py index 989fedd..12ecf1b 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='EBC-Measurements', - version='1.2.0', + version='1.2.1', author='RWTH Aachen University, E.ON Energy Research Center, ' 'Institute for Energy Efficient Buildings and Indoor Climate', author_email='ebc-abos@eonerc.rwth-aachen.de',