From 98ba7a62d4f8dbc339ced7b56aa3772ab135a8ac Mon Sep 17 00:00:00 2001 From: "raoul.dupuis" <raoul.dupuis@hesge.ch> Date: Wed, 9 Oct 2024 13:55:38 +0200 Subject: [PATCH] update for python 3.10 or higher --- README.md | 5 +++++ actuasim/blind.py | 2 +- actuasim/valve.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 056b3eb..cedd965 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,11 @@ Python 3. $ sudo apt-get update $ sudo apt-get install python-pyqt5 ``` +or, for python >= 3.10 : +```shell +$ python3 -m pip install PyQt5 +$ python3 -m pip install PyQt5-tools +``` **N.B.** Python 3 is now the default interpreter in most recent Linux distributions. Do not use Python 2! If unsure, check with: ```shell diff --git a/actuasim/blind.py b/actuasim/blind.py index 587b951..6a8c533 100644 --- a/actuasim/blind.py +++ b/actuasim/blind.py @@ -98,7 +98,7 @@ class BlindWidget(QWidget): if end_value == self.ui.progressBar.value(): return blind_move_speed_ratio = abs(self.ui.progressBar.value()-end_value)/BlindWidget.MAX_PROGRESS_BAR - self.animate_progress.setDuration(self.animation_speed*blind_move_speed_ratio) + self.animate_progress.setDuration(int(self.animation_speed*blind_move_speed_ratio)) self.animate_progress.setStartValue(self.ui.progressBar.value()) self.animate_progress.setEndValue(end_value) self.is_moving = True diff --git a/actuasim/valve.py b/actuasim/valve.py index 755bd6c..5b2cad8 100644 --- a/actuasim/valve.py +++ b/actuasim/valve.py @@ -85,4 +85,4 @@ class ValveWidget(QWidget): angle = (ValveWidget.MAX_PROGRESS_BAR - self.position) * to_180_degree + 90 x = self.line_origin.x() + self.line_length * sin(radians(angle)) y = self.line_origin.y() + self.line_length * cos(radians(angle)) - painter.drawLine(self.line_origin, QPoint(x, y)) + painter.drawLine(self.line_origin, QPoint(int(x), int(y))) -- GitLab