PyInstaller/PyInstallerCleanupDialog.py

Wed, 17 Jan 2018 16:25:59 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 17 Jan 2018 16:25:59 +0100
changeset 3
eb2d30b4d34e
child 4
52f0572b5908
permissions
-rw-r--r--

Continued implementing the PyInstaller interface.

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

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

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

from PyQt5.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(PyInstallerCleanupDialog, self).__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.
        """
        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