PyInstallerInterface/PyInstallerCleanupDialog.py

Wed, 21 Sep 2022 16:45:00 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 21 Sep 2022 16:45:00 +0200
branch
eric7
changeset 46
ccd14067e6a2
parent 43
01ce3d6f7a07
child 53
415055c7aa74
permissions
-rw-r--r--

Reformatted source code with 'Black'.

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

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

"""
Module implementing a dialog to select the cleanup action.
"""

from PyQt6.QtWidgets import QDialog

from .Ui_PyInstallerCleanupDialog import Ui_PyInstallerCleanupDialog


class PyInstallerCleanupDialog(QDialog, Ui_PyInstallerCleanupDialog):
    """
    Class implementing a dialog to select the cleanup action.
    """

    BuildPath = "build"
    DistPath = "dist"

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

        @param parent reference to the parent widget
        @type QWidget
        """
        super().__init__(parent)
        self.setupUi(self)

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

    def getDirectories(self):
        """
        Public method to get the project relative directories to be cleaned.

        @return list of directories to be removed
        @rtype list of str
        """
        dirs = []

        if self.buildButton.isChecked() or self.bothButton.isChecked():
            dirs.append(PyInstallerCleanupDialog.BuildPath)
        if self.distButton.isChecked() or self.bothButton.isChecked():
            dirs.append(PyInstallerCleanupDialog.DistPath)

        return dirs

eric ide

mercurial