From 7f3f9dfa170eafc3ecff9cfddc667c763679bb6b Mon Sep 17 00:00:00 2001 From: Peter Nearing Date: Mon, 9 Sep 2024 10:17:20 -0400 Subject: [PATCH] Fix link thread logic and bump version to 0.5.8.3 Enhance the link thread logic to properly check for cancellation and completion before raising LinkInProgress. Increment version in configuration files to 0.5.8.3 to reflect this update. --- pyproject.toml | 2 +- setup.cfg | 2 +- src/signal_cli_api/__init__.py | 2 +- src/signal_cli_api/signal_cli.py | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2c4846b..b3e9586 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" [project] name = "SignalCliAPi" -version = "0.5.8.2" +version = "0.5.8.3" authors = [ { name="Peter Nearing", email="me@peternearing.ca" } ] diff --git a/setup.cfg b/setup.cfg index bfe0d2d..616307a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = SignalCliApi -version = 0.5.8.2 +version = 0.5.8.3 author = Peter Nearing author_email = me@peternearing.ca description = A python interface to the signal-cli found at https://github.com/AsamK/signal-cli diff --git a/src/signal_cli_api/__init__.py b/src/signal_cli_api/__init__.py index 8021b64..b90be2c 100644 --- a/src/signal_cli_api/__init__.py +++ b/src/signal_cli_api/__init__.py @@ -2,7 +2,7 @@ File: __init__.py Description: A python3 interface to signal-cli. """ -__version__: str = '0.5.8.2' +__version__: str = '0.5.8.3' __author__: str = 'Peter Nearing' __email__: str = 'me@peternearing.ca' diff --git a/src/signal_cli_api/signal_cli.py b/src/signal_cli_api/signal_cli.py index 1e5b3c0..088ab25 100644 --- a/src/signal_cli_api/signal_cli.py +++ b/src/signal_cli_api/signal_cli.py @@ -876,7 +876,8 @@ def start_link_thread(self, :return: None. """ if self._link_thread is not None: - raise LinkInProgress() + if not self._link_thread.is_canceled or not self._link_thread.is_complete: + raise LinkInProgress() self._link_thread = SignalLinkThread( server_address=self._server_address,