PipxInterface/PipxReinstallDialog.py

Sun, 29 Dec 2024 14:56:04 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 29 Dec 2024 14:56:04 +0100
changeset 121
8deb7d8d9b86
parent 104
45c88e73e3dd
permissions
-rw-r--r--

Prepared a new release.

# -*- coding: utf-8 -*-

# Copyright (c) 2024 - 2025 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing a dialog to enter the desired Python interpreter version.
"""

from PyQt6.QtWidgets import QDialog

from .Ui_PipxReinstallDialog import Ui_PipxReinstallDialog


class PipxReinstallDialog(QDialog, Ui_PipxReinstallDialog):
    """
    Class implementing a dialog to enter the desired Python interpreter version.
    """

    def __init__(self, reinstallAll=False, parent=None):
        """
        Constructor

        @param reinstallAll flag indicating to get the parameters for a 'reinstall-all'
            action
        @type bool
        @param parent reference to the parent widget (defaults to None)
        @type QWidget (optional)
        """
        super().__init__(parent)
        self.setupUi(self)

        self.skipGroupBox.setVisible(reinstallAll)

        self.fetchMissingCheckBox.setChecked(True)

        msh = self.minimumSizeHint()
        self.resize(max(self.width(), msh.width()), msh.height())

    def getData(self):
        """
        Public method to get the entered data.

        @return tuple containing the desired Python version, a flag indicating
            to fetch a standalone Python build from GitHub if the specified Python
            version is not found locally on the system and a list of packages to skip
            in case of a 'reinstall-all'
        @rtype tuple of (str, bool, list of str)
        """
        return (
            self.interpreterVersionEdit.text(),
            self.fetchMissingCheckBox.isChecked(),
            [p.strip() for p in self.packagesEdit.text().split()],
        )

eric ide

mercurial