PyInstaller/PyInstallerConfigDialog.py

changeset 28
3c8dbc198753
parent 27
25ff8953e335
child 34
784d24a61fdf
equal deleted inserted replaced
27:25ff8953e335 28:3c8dbc198753
4 # 4 #
5 5
6 """ 6 """
7 Module implementing PyInstallerConfigDialog. 7 Module implementing PyInstallerConfigDialog.
8 """ 8 """
9
10 from __future__ import unicode_literals
11 9
12 import copy 10 import copy
13 11
14 from PyQt5.QtCore import pyqtSlot 12 from PyQt5.QtCore import pyqtSlot
15 from PyQt5.QtWidgets import QDialog, QDialogButtonBox 13 from PyQt5.QtWidgets import QDialog, QDialogButtonBox
40 @param mode mode of the dialog 38 @param mode mode of the dialog
41 @type str (one of 'installer' or 'spec') 39 @type str (one of 'installer' or 'spec')
42 @param parent reference to the parent widget 40 @param parent reference to the parent widget
43 @type QWidget 41 @type QWidget
44 """ 42 """
45 assert mode in ("installer", "spec")
46
47 super(PyInstallerConfigDialog, self).__init__(parent) 43 super(PyInstallerConfigDialog, self).__init__(parent)
48 self.setupUi(self) 44 self.setupUi(self)
49 45
50 self.__project = project 46 self.__project = project
51 self.__mode = mode 47 self.__mode = mode
53 self.inputFilePicker.setMode(E5PathPickerModes.OpenFileMode) 49 self.inputFilePicker.setMode(E5PathPickerModes.OpenFileMode)
54 self.inputFilePicker.setDefaultDirectory( 50 self.inputFilePicker.setDefaultDirectory(
55 self.__project.getProjectPath()) 51 self.__project.getProjectPath())
56 if self.__mode == "installer": 52 if self.__mode == "installer":
57 self.inputFilePicker.setFilters(self.tr( 53 self.inputFilePicker.setFilters(self.tr(
58 "Python Files (*.py *.py2 *.py3);;" 54 "Python Files (*.py *.py3);;"
59 "Python GUI Files (*.pyw *.pyw2 *.pyw3);;" 55 "Python GUI Files (*.pyw *.pyw3);;"
60 "Spec Files (*.spec);;" 56 "Spec Files (*.spec);;"
61 "All Files (*)" 57 "All Files (*)"
62 )) 58 ))
63 elif self.__mode == "spec": 59 elif self.__mode == "spec":
64 self.inputFilePicker.setFilters(self.tr( 60 self.inputFilePicker.setFilters(self.tr(
65 "Python Files (*.py *.py2 *.py3);;" 61 "Python Files (*.py *.py3);;"
66 "Python GUI Files (*.pyw *.pyw2 *.pyw3);;" 62 "Python GUI Files (*.pyw *.pyw3);;"
67 "All Files (*)" 63 "All Files (*)"
68 )) 64 ))
69 65
70 self.executableCombo.addItems(executables) 66 self.executableCombo.addItems(executables)
71 67

eric ide

mercurial