[Pkg-privacy-commits] [Git][pkg-privacy-team/onionshare][hefee/2.6.1-test-qtpy] Add patches to use QtPy instead of PySide6.

Hefee (@hefee) hefee at debian.org
Wed Mar 6 21:39:06 GMT 2024



Hefee pushed to branch hefee/2.6.1-test-qtpy at Privacy Maintainers / onionshare


Commits:
b8b91bc8 by Sandro Knauß at 2024-03-06T22:38:29+01:00
Add patches to use QtPy instead of PySide6.

- - - - -


6 changed files:

- + debian/patches/0002-Use-QtPy-instead-of-directly-PySide6.patch
- + debian/patches/0003-Fix-methods-that-need-int-as-argument-and-not-float.patch
- + debian/patches/0004-add-pytest.ini-to-make-sure-pytest-can-find-all-test.patch
- + debian/patches/0005-add-dependency-on-QtPy-instead-of-PySide6.patch
- + debian/patches/0006-Do-not-install-onionshare_cli-script.patch
- debian/patches/series


Changes:

=====================================
debian/patches/0002-Use-QtPy-instead-of-directly-PySide6.patch
=====================================
@@ -0,0 +1,442 @@
+From: =?utf-8?q?Sandro_Knau=C3=9F?= <hefee at debian.org>
+Date: Wed, 6 Mar 2024 03:38:26 +0100
+Subject: Use QtPy instead of directly PySide6.
+
+---
+ desktop/onionshare/__init__.py                       | 6 +++---
+ desktop/onionshare/connection_tab.py                 | 2 +-
+ desktop/onionshare/gui_common.py                     | 2 +-
+ desktop/onionshare/main_window.py                    | 2 +-
+ desktop/onionshare/moat_dialog.py                    | 2 +-
+ desktop/onionshare/settings_parent_tab.py            | 2 +-
+ desktop/onionshare/settings_tab.py                   | 2 +-
+ desktop/onionshare/tab/mode/__init__.py              | 2 +-
+ desktop/onionshare/tab/mode/chat_mode/__init__.py    | 2 +-
+ desktop/onionshare/tab/mode/file_selection.py        | 2 +-
+ desktop/onionshare/tab/mode/history.py               | 2 +-
+ desktop/onionshare/tab/mode/mode_settings_widget.py  | 2 +-
+ desktop/onionshare/tab/mode/receive_mode/__init__.py | 2 +-
+ desktop/onionshare/tab/mode/share_mode/__init__.py   | 2 +-
+ desktop/onionshare/tab/mode/share_mode/threads.py    | 2 +-
+ desktop/onionshare/tab/mode/website_mode/__init__.py | 2 +-
+ desktop/onionshare/tab/server_status.py              | 4 ++--
+ desktop/onionshare/tab/tab.py                        | 2 +-
+ desktop/onionshare/tab_widget.py                     | 2 +-
+ desktop/onionshare/threads.py                        | 2 +-
+ desktop/onionshare/tor_connection.py                 | 2 +-
+ desktop/onionshare/tor_settings_tab.py               | 2 +-
+ desktop/onionshare/update_checker.py                 | 2 +-
+ desktop/onionshare/widgets.py                        | 2 +-
+ desktop/tests/conftest.py                            | 2 +-
+ desktop/tests/gui_base_test.py                       | 2 +-
+ desktop/tests/test_gui_chat.py                       | 2 +-
+ desktop/tests/test_gui_receive.py                    | 2 +-
+ desktop/tests/test_gui_share.py                      | 2 +-
+ desktop/tests/test_gui_tabs.py                       | 2 +-
+ desktop/tests/test_gui_website.py                    | 2 +-
+ 31 files changed, 34 insertions(+), 34 deletions(-)
+
+diff --git a/desktop/onionshare/__init__.py b/desktop/onionshare/__init__.py
+index 72491e7..e50d430 100644
+--- a/desktop/onionshare/__init__.py
++++ b/desktop/onionshare/__init__.py
+@@ -26,10 +26,10 @@ import signal
+ import json
+ import psutil
+ import getpass
+-from PySide6 import QtCore, QtWidgets, QtGui
++from qtpy import QtCore, QtWidgets, QtGui
+ 
+-from PySide6.QtCore import Slot, Qt
+-from PySide6.QtGui import QPalette, QColor
++from qtpy.QtCore import Slot, Qt
++from qtpy.QtGui import QPalette, QColor
+ 
+ from onionshare_cli.common import Common
+ from onionshare_cli.settings import Settings
+diff --git a/desktop/onionshare/connection_tab.py b/desktop/onionshare/connection_tab.py
+index 452b2b7..99fbde7 100644
+--- a/desktop/onionshare/connection_tab.py
++++ b/desktop/onionshare/connection_tab.py
+@@ -20,7 +20,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ 
+ import json
+ import os
+-from PySide6 import QtCore, QtWidgets, QtGui
++from qtpy import QtCore, QtWidgets, QtGui
+ 
+ from onionshare_cli.censorship import (
+     CensorshipCircumvention,
+diff --git a/desktop/onionshare/gui_common.py b/desktop/onionshare/gui_common.py
+index fcbf47f..9473d30 100644
+--- a/desktop/onionshare/gui_common.py
++++ b/desktop/onionshare/gui_common.py
+@@ -21,7 +21,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ import os
+ import shutil
+ from pkg_resources import resource_filename
+-from PySide6 import QtCore, QtWidgets, QtGui
++from qtpy import QtCore, QtWidgets, QtGui
+ 
+ from . import strings
+ from onionshare_cli.onion import (
+diff --git a/desktop/onionshare/main_window.py b/desktop/onionshare/main_window.py
+index 8ebde01..ba023fd 100644
+--- a/desktop/onionshare/main_window.py
++++ b/desktop/onionshare/main_window.py
+@@ -20,7 +20,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ 
+ import os
+ import time
+-from PySide6 import QtCore, QtWidgets, QtGui
++from qtpy import QtCore, QtWidgets, QtGui
+ 
+ from . import strings
+ from .widgets import Alert
+diff --git a/desktop/onionshare/moat_dialog.py b/desktop/onionshare/moat_dialog.py
+index 6e33a04..a55ee1a 100644
+--- a/desktop/onionshare/moat_dialog.py
++++ b/desktop/onionshare/moat_dialog.py
+@@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ """
+ 
+-from PySide6 import QtCore, QtWidgets, QtGui
++from qtpy import QtCore, QtWidgets, QtGui
+ import requests
+ import os
+ import base64
+diff --git a/desktop/onionshare/settings_parent_tab.py b/desktop/onionshare/settings_parent_tab.py
+index 08815c1..4369ad7 100644
+--- a/desktop/onionshare/settings_parent_tab.py
++++ b/desktop/onionshare/settings_parent_tab.py
+@@ -1,4 +1,4 @@
+-from PySide6 import QtCore, QtWidgets, QtGui
++from qtpy import QtCore, QtWidgets, QtGui
+ 
+ from onionshare_cli.mode_settings import ModeSettings
+ 
+diff --git a/desktop/onionshare/settings_tab.py b/desktop/onionshare/settings_tab.py
+index ad91141..03cfb81 100644
+--- a/desktop/onionshare/settings_tab.py
++++ b/desktop/onionshare/settings_tab.py
+@@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ """
+ 
+-from PySide6 import QtCore, QtWidgets, QtGui
++from qtpy import QtCore, QtWidgets, QtGui
+ import platform
+ import datetime
+ from onionshare_cli.settings import Settings
+diff --git a/desktop/onionshare/tab/mode/__init__.py b/desktop/onionshare/tab/mode/__init__.py
+index 34d78cb..e8344c1 100644
+--- a/desktop/onionshare/tab/mode/__init__.py
++++ b/desktop/onionshare/tab/mode/__init__.py
+@@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ """
+ 
+-from PySide6 import QtCore, QtWidgets
++from qtpy import QtCore, QtWidgets
+ 
+ from onionshare_cli.common import AutoStopTimer
+ 
+diff --git a/desktop/onionshare/tab/mode/chat_mode/__init__.py b/desktop/onionshare/tab/mode/chat_mode/__init__.py
+index cb4f691..554fb9b 100644
+--- a/desktop/onionshare/tab/mode/chat_mode/__init__.py
++++ b/desktop/onionshare/tab/mode/chat_mode/__init__.py
+@@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ """
+ 
+-from PySide6 import QtCore, QtWidgets, QtGui
++from qtpy import QtCore, QtWidgets, QtGui
+ 
+ from onionshare_cli.web import Web
+ 
+diff --git a/desktop/onionshare/tab/mode/file_selection.py b/desktop/onionshare/tab/mode/file_selection.py
+index c03ecaa..ba99e8a 100644
+--- a/desktop/onionshare/tab/mode/file_selection.py
++++ b/desktop/onionshare/tab/mode/file_selection.py
+@@ -19,7 +19,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ """
+ 
+ import os
+-from PySide6 import QtCore, QtWidgets, QtGui
++from qtpy import QtCore, QtWidgets, QtGui
+ 
+ from ... import strings
+ from ...widgets import Alert, AddFileDialog
+diff --git a/desktop/onionshare/tab/mode/history.py b/desktop/onionshare/tab/mode/history.py
+index 3afdfc1..1468b53 100644
+--- a/desktop/onionshare/tab/mode/history.py
++++ b/desktop/onionshare/tab/mode/history.py
+@@ -22,7 +22,7 @@ import time
+ import subprocess
+ import os
+ from datetime import datetime
+-from PySide6 import QtCore, QtWidgets, QtGui
++from qtpy import QtCore, QtWidgets, QtGui
+ 
+ from ... import strings
+ from ...widgets import Alert
+diff --git a/desktop/onionshare/tab/mode/mode_settings_widget.py b/desktop/onionshare/tab/mode/mode_settings_widget.py
+index 9a8cd44..315adde 100644
+--- a/desktop/onionshare/tab/mode/mode_settings_widget.py
++++ b/desktop/onionshare/tab/mode/mode_settings_widget.py
+@@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ """
+ 
+-from PySide6 import QtCore, QtWidgets
++from qtpy import QtCore, QtWidgets
+ 
+ from ... import strings
+ 
+diff --git a/desktop/onionshare/tab/mode/receive_mode/__init__.py b/desktop/onionshare/tab/mode/receive_mode/__init__.py
+index bfa8545..49714a4 100644
+--- a/desktop/onionshare/tab/mode/receive_mode/__init__.py
++++ b/desktop/onionshare/tab/mode/receive_mode/__init__.py
+@@ -19,7 +19,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ """
+ 
+ import os
+-from PySide6 import QtCore, QtWidgets, QtGui
++from qtpy import QtCore, QtWidgets, QtGui
+ 
+ from onionshare_cli.web import Web
+ 
+diff --git a/desktop/onionshare/tab/mode/share_mode/__init__.py b/desktop/onionshare/tab/mode/share_mode/__init__.py
+index daa35a4..e7d14aa 100644
+--- a/desktop/onionshare/tab/mode/share_mode/__init__.py
++++ b/desktop/onionshare/tab/mode/share_mode/__init__.py
+@@ -19,7 +19,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ """
+ 
+ import os
+-from PySide6 import QtCore, QtWidgets, QtGui
++from qtpy import QtCore, QtWidgets, QtGui
+ 
+ from onionshare_cli.common import Common
+ from onionshare_cli.web import Web
+diff --git a/desktop/onionshare/tab/mode/share_mode/threads.py b/desktop/onionshare/tab/mode/share_mode/threads.py
+index 77a5cb6..d8f7e8e 100644
+--- a/desktop/onionshare/tab/mode/share_mode/threads.py
++++ b/desktop/onionshare/tab/mode/share_mode/threads.py
+@@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ """
+ 
+-from PySide6 import QtCore
++from qtpy import QtCore
+ 
+ 
+ class CompressThread(QtCore.QThread):
+diff --git a/desktop/onionshare/tab/mode/website_mode/__init__.py b/desktop/onionshare/tab/mode/website_mode/__init__.py
+index 47614ca..c232022 100644
+--- a/desktop/onionshare/tab/mode/website_mode/__init__.py
++++ b/desktop/onionshare/tab/mode/website_mode/__init__.py
+@@ -20,7 +20,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ 
+ import os
+ 
+-from PySide6 import QtCore, QtWidgets, QtGui
++from qtpy import QtCore, QtWidgets, QtGui
+ 
+ from onionshare_cli.common import Common
+ from onionshare_cli.web import Web
+diff --git a/desktop/onionshare/tab/server_status.py b/desktop/onionshare/tab/server_status.py
+index 185033c..79be25c 100644
+--- a/desktop/onionshare/tab/server_status.py
++++ b/desktop/onionshare/tab/server_status.py
+@@ -18,8 +18,8 @@ You should have received a copy of the GNU General Public License
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ """
+ import textwrap
+-from PySide6 import QtCore, QtWidgets, QtGui
+-from PySide6.QtCore import Qt
++from qtpy import QtCore, QtWidgets, QtGui
++from qtpy.QtCore import Qt
+ 
+ from .. import strings
+ from ..widgets import Alert
+diff --git a/desktop/onionshare/tab/tab.py b/desktop/onionshare/tab/tab.py
+index ab6cc3e..8a44912 100644
+--- a/desktop/onionshare/tab/tab.py
++++ b/desktop/onionshare/tab/tab.py
+@@ -19,7 +19,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ """
+ 
+ import queue
+-from PySide6 import QtCore, QtWidgets, QtGui
++from qtpy import QtCore, QtWidgets, QtGui
+ 
+ from onionshare_cli.onionshare import OnionShare
+ from onionshare_cli.web import Web
+diff --git a/desktop/onionshare/tab_widget.py b/desktop/onionshare/tab_widget.py
+index 2a867ba..29a68f3 100644
+--- a/desktop/onionshare/tab_widget.py
++++ b/desktop/onionshare/tab_widget.py
+@@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ """
+ 
+-from PySide6 import QtCore, QtWidgets, QtGui
++from qtpy import QtCore, QtWidgets, QtGui
+ 
+ from onionshare_cli.mode_settings import ModeSettings
+ 
+diff --git a/desktop/onionshare/threads.py b/desktop/onionshare/threads.py
+index 6eeeb97..4386d33 100644
+--- a/desktop/onionshare/threads.py
++++ b/desktop/onionshare/threads.py
+@@ -21,7 +21,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ import time
+ import json
+ import os
+-from PySide6 import QtCore
++from qtpy import QtCore
+ 
+ from onionshare_cli.onion import (
+     TorErrorInvalidSetting,
+diff --git a/desktop/onionshare/tor_connection.py b/desktop/onionshare/tor_connection.py
+index f87967e..7021189 100644
+--- a/desktop/onionshare/tor_connection.py
++++ b/desktop/onionshare/tor_connection.py
+@@ -19,7 +19,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ """
+ 
+ import time
+-from PySide6 import QtCore, QtWidgets
++from qtpy import QtCore, QtWidgets
+ 
+ from onionshare_cli.onion import (
+     BundledTorCanceled,
+diff --git a/desktop/onionshare/tor_settings_tab.py b/desktop/onionshare/tor_settings_tab.py
+index a7aa4bb..22f974f 100644
+--- a/desktop/onionshare/tor_settings_tab.py
++++ b/desktop/onionshare/tor_settings_tab.py
+@@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ """
+ 
+-from PySide6 import QtCore, QtWidgets, QtGui
++from qtpy import QtCore, QtWidgets, QtGui
+ import sys
+ import platform
+ import os
+diff --git a/desktop/onionshare/update_checker.py b/desktop/onionshare/update_checker.py
+index 6d0662a..a4654c6 100644
+--- a/desktop/onionshare/update_checker.py
++++ b/desktop/onionshare/update_checker.py
+@@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ """
+ 
+-from PySide6 import QtCore
++from qtpy import QtCore
+ import datetime
+ import re
+ import socks
+diff --git a/desktop/onionshare/widgets.py b/desktop/onionshare/widgets.py
+index 2eacc77..e2f101d 100644
+--- a/desktop/onionshare/widgets.py
++++ b/desktop/onionshare/widgets.py
+@@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ """
+ 
+-from PySide6 import QtCore, QtWidgets, QtGui
++from qtpy import QtCore, QtWidgets, QtGui
+ import qrcode
+ 
+ from . import strings
+diff --git a/desktop/tests/conftest.py b/desktop/tests/conftest.py
+index 73517e6..5d1e562 100644
+--- a/desktop/tests/conftest.py
++++ b/desktop/tests/conftest.py
+@@ -2,7 +2,7 @@ import sys
+ import os
+ from datetime import datetime, timedelta
+ 
+-from PySide6 import QtTest
++from qtpy import QtTest
+ 
+ 
+ # Force tests to look for resources in the source code tree
+diff --git a/desktop/tests/gui_base_test.py b/desktop/tests/gui_base_test.py
+index af391a0..d2a24d0 100644
+--- a/desktop/tests/gui_base_test.py
++++ b/desktop/tests/gui_base_test.py
+@@ -7,7 +7,7 @@ import secrets
+ import platform
+ import sys
+ 
+-from PySide6 import QtCore, QtTest, QtWidgets
++from qtpy import QtCore, QtTest, QtWidgets
+ 
+ from onionshare_cli.common import Common
+ 
+diff --git a/desktop/tests/test_gui_chat.py b/desktop/tests/test_gui_chat.py
+index 1b5e4e6..9f7365b 100644
+--- a/desktop/tests/test_gui_chat.py
++++ b/desktop/tests/test_gui_chat.py
+@@ -1,6 +1,6 @@
+ import requests
+ 
+-from PySide6 import QtTest
++from qtpy import QtTest
+ 
+ from .gui_base_test import GuiBaseTest
+ 
+diff --git a/desktop/tests/test_gui_receive.py b/desktop/tests/test_gui_receive.py
+index 11f2d60..5136c70 100644
+--- a/desktop/tests/test_gui_receive.py
++++ b/desktop/tests/test_gui_receive.py
+@@ -6,7 +6,7 @@ import shutil
+ import sys
+ from datetime import datetime, timedelta
+ 
+-from PySide6 import QtCore, QtTest
++from qtpy import QtCore, QtTest
+ 
+ from .gui_base_test import GuiBaseTest
+ 
+diff --git a/desktop/tests/test_gui_share.py b/desktop/tests/test_gui_share.py
+index f0c460f..cf13efc 100644
+--- a/desktop/tests/test_gui_share.py
++++ b/desktop/tests/test_gui_share.py
+@@ -3,7 +3,7 @@ import requests
+ import tempfile
+ import zipfile
+ 
+-from PySide6 import QtCore, QtTest
++from qtpy import QtCore, QtTest
+ 
+ from .gui_base_test import GuiBaseTest
+ 
+diff --git a/desktop/tests/test_gui_tabs.py b/desktop/tests/test_gui_tabs.py
+index b0e2466..92dae1a 100644
+--- a/desktop/tests/test_gui_tabs.py
++++ b/desktop/tests/test_gui_tabs.py
+@@ -1,6 +1,6 @@
+ import os
+ 
+-from PySide6 import QtCore, QtTest, QtWidgets
++from qtpy import QtCore, QtTest, QtWidgets
+ 
+ from .gui_base_test import GuiBaseTest
+ 
+diff --git a/desktop/tests/test_gui_website.py b/desktop/tests/test_gui_website.py
+index 8009355..9f9ffa2 100644
+--- a/desktop/tests/test_gui_website.py
++++ b/desktop/tests/test_gui_website.py
+@@ -1,6 +1,6 @@
+ import requests
+ 
+-from PySide6 import QtTest
++from qtpy import QtTest
+ 
+ from .gui_base_test import GuiBaseTest
+ 


=====================================
debian/patches/0003-Fix-methods-that-need-int-as-argument-and-not-float.patch
=====================================
@@ -0,0 +1,104 @@
+From: =?utf-8?q?Sandro_Knau=C3=9F?= <hefee at debian.org>
+Date: Wed, 6 Mar 2024 18:49:59 +0100
+Subject: Fix methods that need int as argument and not float.
+
+---
+ desktop/onionshare/gui_common.py       |  2 ++
+ desktop/onionshare/tab/mode/history.py | 12 ++++++------
+ desktop/onionshare/tab/tab.py          |  6 +++---
+ 3 files changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/desktop/onionshare/gui_common.py b/desktop/onionshare/gui_common.py
+index 9473d30..204d323 100644
+--- a/desktop/onionshare/gui_common.py
++++ b/desktop/onionshare/gui_common.py
+@@ -624,9 +624,11 @@ class ToggleCheckbox(QtWidgets.QCheckBox):
+         x = (
+             rect.width() - rect.x() - self.w + 20
+         )  # 20 is the padding between text and toggle
++        x = int(x)
+         y = (
+             self.height() / 2 - self.h / 2 + 16
+         )  # 16 is the padding top for the checkbox
++        y = int(y)
+         self.toggleRect = QtCore.QRect(x, y, self.w, self.h)
+         painter.setBrush(QtGui.QColor(self.bg_color))
+         painter.drawRoundedRect(x, y, self.w, self.h, self.h / 2, self.h / 2)
+diff --git a/desktop/onionshare/tab/mode/history.py b/desktop/onionshare/tab/mode/history.py
+index 1468b53..166bc15 100644
+--- a/desktop/onionshare/tab/mode/history.py
++++ b/desktop/onionshare/tab/mode/history.py
+@@ -121,7 +121,7 @@ class ShareHistoryItem(HistoryItem):
+         self.progress_bar.setAttribute(QtCore.Qt.WA_DeleteOnClose)
+         self.progress_bar.setAlignment(QtCore.Qt.AlignHCenter)
+         self.progress_bar.setMinimum(0)
+-        self.progress_bar.setMaximum(total_bytes / 1024)
++        self.progress_bar.setMaximum(total_bytes // 1024)
+         self.progress_bar.setValue(0)
+         self.progress_bar.setStyleSheet(
+             self.common.gui.css["downloads_uploads_progress_bar"]
+@@ -140,7 +140,7 @@ class ShareHistoryItem(HistoryItem):
+     def update(self, downloaded_bytes):
+         self.downloaded_bytes = downloaded_bytes
+ 
+-        self.progress_bar.setValue(downloaded_bytes / 1024)
++        self.progress_bar.setValue(downloaded_bytes // 1024)
+         if (downloaded_bytes / 1024) == (self.progress_bar.total_bytes / 1024):
+             pb_fmt = strings._("gui_all_modes_progress_complete").format(
+                 self.common.format_seconds(time.time() - self.started)
+@@ -392,8 +392,8 @@ class ReceiveHistoryItem(HistoryItem):
+                 total_uploaded_bytes += data["progress"][filename]["uploaded_bytes"]
+ 
+             # Update the progress bar
+-            self.progress_bar.setMaximum(self.content_length / 1024)
+-            self.progress_bar.setValue(total_uploaded_bytes / 1024)
++            self.progress_bar.setMaximum(self.content_length // 1024)
++            self.progress_bar.setValue(total_uploaded_bytes // 1024)
+ 
+             elapsed = datetime.now() - self.started
+             if elapsed.seconds < 10:
+@@ -526,7 +526,7 @@ class IndividualFileHistoryItem(HistoryItem):
+         else:
+             self.total_bytes = data["filesize"]
+             self.progress_bar.setMinimum(0)
+-            self.progress_bar.setMaximum(data["filesize"] / 1024)
++            self.progress_bar.setMaximum(data["filesize"] // 1024)
+             self.progress_bar.total_bytes = data["filesize"]
+ 
+         # Start at 0
+@@ -535,7 +535,7 @@ class IndividualFileHistoryItem(HistoryItem):
+     def update(self, downloaded_bytes):
+         self.downloaded_bytes = downloaded_bytes
+ 
+-        self.progress_bar.setValue(downloaded_bytes / 1024)
++        self.progress_bar.setValue(downloaded_bytes // 1024)
+         if (downloaded_bytes / 1024) == (self.progress_bar.total_bytes / 1024):
+             self.status_code_label.setText("200")
+             self.status_code_label.setStyleSheet(
+diff --git a/desktop/onionshare/tab/tab.py b/desktop/onionshare/tab/tab.py
+index 8a44912..766a381 100644
+--- a/desktop/onionshare/tab/tab.py
++++ b/desktop/onionshare/tab/tab.py
+@@ -69,11 +69,11 @@ class NewTabButton(QtWidgets.QPushButton):
+         self.title_label.setStyleSheet(self.common.gui.css["new_tab_title_text"])
+         if self.title_label.sizeHint().width() >= 250:
+             self.title_label.setGeometry(
+-                (self.width() - 250) / 2, self.height() - 120, 250, 60
++                (self.width() - 250) // 2, self.height() - 120, 250, 60
+             )
+         else:
+             self.title_label.setGeometry(
+-                (self.width() - 250) / 2, self.height() - 100, 250, 30
++                (self.width() - 250) // 2, self.height() - 100, 250, 30
+             )
+         self.title_label.show()
+ 
+@@ -82,7 +82,7 @@ class NewTabButton(QtWidgets.QPushButton):
+         self.text_label.setAlignment(QtCore.Qt.AlignCenter)
+         self.text_label.setStyleSheet(self.common.gui.css["new_tab_button_text"])
+         self.text_label.setGeometry(
+-            (self.width() - 200) / 2, self.height() - 50, 200, 30
++            (self.width() - 200) // 2, self.height() - 50, 200, 30
+         )
+         self.text_label.show()
+ 


=====================================
debian/patches/0004-add-pytest.ini-to-make-sure-pytest-can-find-all-test.patch
=====================================
@@ -0,0 +1,19 @@
+From: =?utf-8?q?Sandro_Knau=C3=9F?= <hefee at debian.org>
+Date: Wed, 6 Mar 2024 18:50:45 +0100
+Subject: add pytest.ini to make sure pytest can find all tests.
+
+---
+ desktop/tests/pytest.ini | 4 ++++
+ 1 file changed, 4 insertions(+)
+ create mode 100644 desktop/tests/pytest.ini
+
+diff --git a/desktop/tests/pytest.ini b/desktop/tests/pytest.ini
+new file mode 100644
+index 0000000..9368b52
+--- /dev/null
++++ b/desktop/tests/pytest.ini
+@@ -0,0 +1,4 @@
++[pytest]
++python_files = test*.py
++python_classes = Test
++python_functions = test


=====================================
debian/patches/0005-add-dependency-on-QtPy-instead-of-PySide6.patch
=====================================
@@ -0,0 +1,21 @@
+From: =?utf-8?q?Sandro_Knau=C3=9F?= <hefee at debian.org>
+Date: Wed, 6 Mar 2024 20:59:01 +0100
+Subject: add dependency on QtPy instead of PySide6.
+
+---
+ desktop/pyproject.toml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/desktop/pyproject.toml b/desktop/pyproject.toml
+index d5745ed..3e66570 100644
+--- a/desktop/pyproject.toml
++++ b/desktop/pyproject.toml
+@@ -8,7 +8,7 @@ license = "GPLv3+"
+ [tool.poetry.dependencies]
+ python = ">=3.8,<3.12"
+ onionshare_cli = {path = "../cli", develop = true}
+-PySide6 = "6.5.2"
++qtpy = "*"
+ qrcode = "*"
+ werkzeug = "*"
+ python-gnupg = "*"


=====================================
debian/patches/0006-Do-not-install-onionshare_cli-script.patch
=====================================
@@ -0,0 +1,17 @@
+From: =?utf-8?q?Sandro_Knau=C3=9F?= <hefee at debian.org>
+Date: Wed, 6 Mar 2024 20:59:21 +0100
+Subject: Do not install onionshare_cli script.
+
+---
+ desktop/pyproject.toml | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/desktop/pyproject.toml b/desktop/pyproject.toml
+index 3e66570..c979a3e 100644
+--- a/desktop/pyproject.toml
++++ b/desktop/pyproject.toml
+@@ -28,4 +28,3 @@ build-backend = "poetry.core.masonry.api"
+ 
+ [tool.poetry.scripts]
+ onionshare = 'onionshare:main'
+-onionshare-cli = 'onionshare_cli:main'


=====================================
debian/patches/series
=====================================
@@ -1 +1,6 @@
 0001-Make-it-compatible-with-Flask-version-inside-Debian.patch
+0002-Use-QtPy-instead-of-directly-PySide6.patch
+0003-Fix-methods-that-need-int-as-argument-and-not-float.patch
+0004-add-pytest.ini-to-make-sure-pytest-can-find-all-test.patch
+0005-add-dependency-on-QtPy-instead-of-PySide6.patch
+0006-Do-not-install-onionshare_cli-script.patch



View it on GitLab: https://salsa.debian.org/pkg-privacy-team/onionshare/-/commit/b8b91bc84f8e4f923dc1e1f76b1061dcb6ea2cf6

-- 
View it on GitLab: https://salsa.debian.org/pkg-privacy-team/onionshare/-/commit/b8b91bc84f8e4f923dc1e1f76b1061dcb6ea2cf6
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-privacy-commits/attachments/20240306/3665f5f3/attachment-0001.htm>


More information about the Pkg-privacy-commits mailing list