PyInstallerInterface/PyInstallerCleanupDialog.py

branch
eric7
changeset 38
fc9ef9dcd51a
parent 35
d9b3cadaf707
child 43
01ce3d6f7a07
equal deleted inserted replaced
37:9ecfea29a47c 38:fc9ef9dcd51a
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2018 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing a dialog to select the cleanup action.
8 """
9
10 from PyQt6.QtWidgets import QDialog
11
12 from .Ui_PyInstallerCleanupDialog import Ui_PyInstallerCleanupDialog
13
14
15 class PyInstallerCleanupDialog(QDialog, Ui_PyInstallerCleanupDialog):
16 """
17 Class implementing a dialog to select the cleanup action.
18 """
19 BuildPath = "build"
20 DistPath = "dist"
21
22 def __init__(self, parent=None):
23 """
24 Constructor
25
26 @param parent reference to the parent widget
27 @type QWidget
28 """
29 super().__init__(parent)
30 self.setupUi(self)
31
32 msh = self.minimumSizeHint()
33 self.resize(max(self.width(), msh.width()), msh.height())
34
35 def getDirectories(self):
36 """
37 Public method to get the project relative directories to be cleaned.
38
39 @return list of directories to be removed
40 @rtype list of str
41 """
42 dirs = []
43
44 if self.buildButton.isChecked() or self.bothButton.isChecked():
45 dirs.append(PyInstallerCleanupDialog.BuildPath)
46 if self.distButton.isChecked() or self.bothButton.isChecked():
47 dirs.append(PyInstallerCleanupDialog.DistPath)
48
49 return dirs

eric ide

mercurial