Wed, 21 Sep 2022 16:47:33 +0200
Reformatted source code with 'Black'.
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
136
d9228f38cfe8
Updated copyright for 2022.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
134
diff
changeset
|
3 | # Copyright (c) 2010 - 2022 Detlev Offenbach <detlev@die-offenbachs.de> |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
7 | Module implementing a dialog to enter the parameters for cxfreeze. |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | """ |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
10 | import sys |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
11 | import os |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
12 | import copy |
131
86d810eea380
Implemented some code simplifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
130
diff
changeset
|
13 | import contextlib |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
14 | |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
15 | from PyQt6.QtCore import pyqtSlot, QDir, QProcess |
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
16 | from PyQt6.QtWidgets import QDialog, QListWidgetItem |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
17 | |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
18 | from EricWidgets.EricPathPicker import EricPathPickerModes |
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
19 | from EricWidgets.EricDirFileDialog import EricDirFileDialog |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
20 | |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
21 | from .Ui_CxfreezeConfigDialog import Ui_CxfreezeConfigDialog |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
22 | |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
23 | import Utilities |
73
b704e562c4f5
Added some eye-candy and updated source docu and translations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
72
diff
changeset
|
24 | import UI.PixmapCache |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
25 | |
56
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
26 | |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
27 | class CxfreezeConfigDialog(QDialog, Ui_CxfreezeConfigDialog): |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
28 | """ |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
29 | Class implementing a dialog to enter the parameters for cxfreeze. |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
30 | """ |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
31 | |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
32 | def __init__(self, project, exe, parms=None, parent=None): |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
33 | """ |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
34 | Constructor |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
35 | |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
36 | @param project reference to the project object |
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
37 | @type Project |
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
38 | @param exe name of the cxfreeze executable |
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
39 | @type str |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | @param parms parameters to set in the dialog |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
41 | @type dict |
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
42 | @param parent parent widget of this dialog |
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
43 | @type QWidget |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
44 | """ |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
45 | QDialog.__init__(self, parent) |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
46 | self.setupUi(self) |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
47 | |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
48 | self.selectFileOrFolderButton.setIcon(UI.PixmapCache.getIcon("open.png")) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
49 | |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
50 | self.targetDirPicker.setMode(EricPathPickerModes.DIRECTORY_MODE) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
51 | self.targetDirPicker.setWindowTitle(self.tr("Select target directory")) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
52 | |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
53 | iconsI18N = self.tr("Icons") |
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
54 | allFilesI18N = self.tr("All files") |
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
55 | if Utilities.isWindowsPlatform(): |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
56 | iconFilter = "{0} (*.ico);;{1} (*.*)".format(iconsI18N, allFilesI18N) |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
57 | elif Utilities.isMacPlatform(): |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
58 | iconFilter = "{0} (*.icns *.png);;{1} (*.*)".format(iconsI18N, allFilesI18N) |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
59 | else: |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
60 | iconFilter = "{0} (*.png);;{1} (*.*)".format(iconsI18N, allFilesI18N) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
61 | self.applicationIconPicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
62 | self.applicationIconPicker.setWindowTitle( |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
63 | self.tr("Select the application icon") |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
64 | ) |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
65 | self.applicationIconPicker.setFilters(iconFilter) |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
66 | |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
67 | self.extListFilePicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
68 | self.extListFilePicker.setWindowTitle(self.tr("Select external list file")) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
69 | |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
70 | self.__project = project |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
71 | self.__initializeDefaults() |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
72 | |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
73 | # get a copy of the defaults to store the user settings |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
74 | self.__parameters = copy.deepcopy(self.defaults) |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
75 | |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
76 | # combine it with the values of parms |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
77 | if parms is not None: |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
78 | self.__parameters.update(parms) |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
79 | |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
80 | self.cxfreezeExecCombo.addItems(exe) |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
81 | # try to set the saved script path |
131
86d810eea380
Implemented some code simplifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
130
diff
changeset
|
82 | with contextlib.suppress(ValueError): |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
83 | idx = exe.index(self.__parameters["script"]) |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
84 | self.cxfreezeExecCombo.setCurrentIndex(idx) |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
85 | |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
86 | # initialize general tab |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
87 | self.targetDirPicker.setText(self.__parameters["targetDirectory"]) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
88 | self.targetNameEdit.setText(self.__parameters["targetName"]) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
89 | self.basenameCombo.setEditText(self.__parameters["baseName"]) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
90 | self.initscriptCombo.setEditText(self.__parameters["initScript"]) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
91 | self.applicationIconPicker.setText(self.__parameters["applicationIcon"]) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
92 | self.keeppathCheckBox.setChecked(self.__parameters["keepPath"]) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
93 | self.compressCheckBox.setChecked(self.__parameters["compress"]) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
94 | if self.__parameters["optimize"] == 0: |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
95 | self.nooptimizeRadioButton.setChecked(True) |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
96 | elif self.__parameters["optimize"] == 1: |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
97 | self.optimizeRadioButton.setChecked(True) |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
98 | else: |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
99 | self.optimizeDocRadioButton.setChecked(True) |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
100 | |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
101 | # initialize advanced tab |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
102 | self.defaultPathEdit.setText(os.pathsep.join(self.__parameters["defaultPath"])) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
103 | self.includePathEdit.setText(os.pathsep.join(self.__parameters["includePath"])) |
64
c878aac7d3f5
Fixed code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
61
diff
changeset
|
104 | self.replacePathsEdit.setText( |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
105 | os.pathsep.join(self.__parameters["replacePaths"]) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
106 | ) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
107 | self.includeModulesEdit.setText(",".join(self.__parameters["includeModules"])) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
108 | self.excludeModulesEdit.setText(",".join(self.__parameters["excludeModules"])) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
109 | self.extListFilePicker.setText(self.__parameters["extListFile"]) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
110 | |
56
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
111 | # initialize additional files tab |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
112 | self.fileOrFolderList.addItems(self.__parameters["additionalFiles"]) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
113 | |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
114 | def __initializeDefaults(self): |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
115 | """ |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
116 | Private method to set the default values. |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
117 | |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
118 | These are needed later on to generate the command line parameters. |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
119 | """ |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
120 | self.defaults = { |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
121 | # general options |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
122 | "targetDirectory": "", |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
123 | "targetName": "", |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
124 | "baseName": "Console", |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
125 | "initScript": "Console", |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
126 | "applicationIcon": "", |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
127 | "script": "", |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
128 | "keepPath": False, |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
129 | "compress": False, |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
130 | "optimize": 0, # 0, 1 or 2 |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
131 | # advanced options |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
132 | "defaultPath": [], |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
133 | "includePath": [], |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
134 | "replacePaths": [], |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
135 | "includeModules": [], |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
136 | "excludeModules": [], |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
137 | "extListFile": "", |
56
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
138 | # additional files tab |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
139 | "additionalFiles": [], |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
140 | } |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
141 | # overwrite 'baseName' if OS is Windows |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
142 | if sys.platform == "win32": |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
143 | self.defaults["baseName"] = "Win32GUI" |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
144 | # overwrite 'initScript' if version 3 interpreter |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
145 | if self.__project.getProjectLanguage() == "Python3": |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
146 | self.defaults["initScript"] = "Console3" |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
147 | |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
148 | def generateParameters(self): |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
149 | """ |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
150 | Public method that generates the command line parameters. |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
151 | |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
152 | It generates a list of strings to be used to set the QProcess arguments |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
153 | for the cxfreeze call and a list containing the non default parameters. |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
154 | The second list can be passed back upon object generation to overwrite |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
155 | the default settings. |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
156 | |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
157 | @return a tuple of the command line parameters and non default |
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
158 | parameters |
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
159 | @rtype tuple of (list of str, dict) |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
160 | """ |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
161 | parms = {} |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
162 | args = [] |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
163 | |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
164 | # 1. the program name |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
165 | args.append(self.cxfreezeExecCombo.currentText()) |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
166 | |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
167 | # 2. the commandline options |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
168 | # 2.1 general options |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
169 | if self.__parameters["targetDirectory"] != self.defaults["targetDirectory"]: |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
170 | parms["targetDirectory"] = self.__parameters["targetDirectory"] |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
171 | args.append("--target-dir={0}".format(self.__parameters["targetDirectory"])) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
172 | if self.__parameters["targetName"] != self.defaults["targetName"]: |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
173 | parms["targetName"] = self.__parameters["targetName"][:] |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
174 | args.append("--target-name={0}".format(self.__parameters["targetName"])) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
175 | parms["baseName"] = self.__parameters["baseName"][:] |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
176 | if self.__parameters["baseName"] != "": |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
177 | args.append("--base-name={0}".format(self.__parameters["baseName"])) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
178 | parms["initScript"] = self.__parameters["initScript"][:] |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
179 | if self.__parameters["initScript"] != "": |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
180 | args.append("--init-script={0}".format(self.__parameters["initScript"])) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
181 | parms["applicationIcon"] = self.__parameters["applicationIcon"][:] |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
182 | if self.__parameters["applicationIcon"] != self.defaults["applicationIcon"]: |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
183 | args.append("--icon={0}".format(self.__parameters["applicationIcon"])) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
184 | parms["script"] = self.__parameters["script"][:] |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
185 | if self.__parameters["keepPath"] != self.defaults["keepPath"]: |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
186 | parms["keepPath"] = self.__parameters["keepPath"] |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
187 | args.append("--no-copy-deps") |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
188 | if self.__parameters["compress"] != self.defaults["compress"]: |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
189 | parms["compress"] = self.__parameters["compress"] |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
190 | args.append("--compress") |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
191 | if self.__parameters["optimize"] != self.defaults["optimize"]: |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
192 | parms["optimize"] = self.__parameters["optimize"] |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
193 | if self.__parameters["optimize"] == 1: |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
194 | args.append("-O") |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
195 | elif self.__parameters["optimize"] == 2: |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
196 | args.append("-OO") |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
197 | |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
198 | # 2.2 advanced options |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
199 | if self.__parameters["defaultPath"] != self.defaults["defaultPath"]: |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
200 | parms["defaultPath"] = self.__parameters["defaultPath"][:] |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
201 | args.append( |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
202 | "--default-path={0}".format( |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
203 | os.pathsep.join(self.__parameters["defaultPath"]) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
204 | ) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
205 | ) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
206 | if self.__parameters["includePath"] != self.defaults["includePath"]: |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
207 | parms["includePath"] = self.__parameters["includePath"][:] |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
208 | args.append( |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
209 | "--include-path={0}".format( |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
210 | os.pathsep.join(self.__parameters["includePath"]) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
211 | ) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
212 | ) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
213 | if self.__parameters["replacePaths"] != self.defaults["replacePaths"]: |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
214 | parms["replacePaths"] = self.__parameters["replacePaths"][:] |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
215 | args.append( |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
216 | "--replace-paths={0}".format( |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
217 | os.pathsep.join(self.__parameters["replacePaths"]) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
218 | ) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
219 | ) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
220 | if self.__parameters["includeModules"] != self.defaults["includeModules"]: |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
221 | parms["includeModules"] = self.__parameters["includeModules"][:] |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
222 | args.append( |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
223 | "--include-modules={0}".format( |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
224 | ",".join(self.__parameters["includeModules"]) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
225 | ) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
226 | ) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
227 | if self.__parameters["excludeModules"] != self.defaults["excludeModules"]: |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
228 | parms["excludeModules"] = self.__parameters["excludeModules"][:] |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
229 | args.append( |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
230 | "--exclude-modules={0}".format( |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
231 | ",".join(self.__parameters["excludeModules"]) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
232 | ) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
233 | ) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
234 | if self.__parameters["extListFile"] != self.defaults["extListFile"]: |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
235 | parms["extListFile"] = self.__parameters["extListFile"] |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
236 | args.append("--ext-list-file={0}".format(self.__parameters["extListFile"])) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
237 | |
56
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
238 | # 2.3 additional files tab |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
239 | if self.__parameters["additionalFiles"] != []: |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
240 | parms["additionalFiles"] = self.__parameters["additionalFiles"][:] |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
241 | |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
242 | return (args, parms) |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
243 | |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
244 | @pyqtSlot(str) |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
245 | def on_cxfreezeExecCombo_currentIndexChanged(self, text): |
57
ddf3165e3d62
Some changes to the changes sent by Tobias.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
56
diff
changeset
|
246 | """ |
ddf3165e3d62
Some changes to the changes sent by Tobias.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
56
diff
changeset
|
247 | Private slot to handle the selection of a cxfreeze executable. |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
248 | |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
249 | @param text selected cxfreeze executable |
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
250 | @type str |
57
ddf3165e3d62
Some changes to the changes sent by Tobias.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
56
diff
changeset
|
251 | """ |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
252 | # version specific setup |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
253 | if Utilities.isWindowsPlatform(): |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
254 | # remove "\Scripts\cx_Freeze.bat" from path |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
255 | dirname = os.path.dirname(text) |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
256 | dirname = os.path.dirname(dirname) |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
257 | |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
258 | # first try the fast way |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
259 | modpath = os.path.join(dirname, "Lib", "site-packages", "cx_Freeze") |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
260 | if not os.path.exists(modpath): |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
261 | # but if it failed search in the whole directory tree |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
262 | modpath = None |
112
031d64d92dc8
Adjusted the code style checking parameters and fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
109
diff
changeset
|
263 | for dirpath, dirnames, _ in os.walk(dirname): |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
264 | if "cx_Freeze" in dirnames: |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
265 | modpath = os.path.join(dirpath, "cx_Freeze") |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
266 | break |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
267 | else: |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
268 | with open(text, "r") as f: |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
269 | args = f.readline() |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
270 | if not args: |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
271 | return |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
272 | |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
273 | args = args.strip("!#\n").split(" ") |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
274 | program = args.pop(0) |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
275 | |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
276 | script = os.path.join( |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
277 | os.path.dirname(os.path.abspath(__file__)), "CxfreezeFindPath.py" |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
278 | ) |
49
202045ed3992
Some little enhancements to Tobias' patches.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
47
diff
changeset
|
279 | if not os.path.exists(script): |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
280 | return |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
281 | |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
282 | args.append(script) |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
283 | process = QProcess() |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
284 | process.start(program, args) |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
285 | process.waitForFinished(5000) |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
286 | # get a QByteArray of the output |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
287 | cxPath = process.readAllStandardOutput() |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
288 | modpath = str(cxPath, encoding="utf-8").strip("\n\r") |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
289 | if not modpath.endswith("cx_Freeze"): |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
290 | return |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
291 | |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
292 | # populate combo boxes |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
293 | if modpath: |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
294 | d = QDir(os.path.join(modpath, "bases")) |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
295 | basesList = d.entryList(QDir.Filter.Files) |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
296 | if Utilities.isWindowsPlatform(): |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
297 | # strip the final '.exe' from the bases |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
298 | tmpBasesList = basesList[:] |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
299 | basesList = [] |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
300 | for b in tmpBasesList: |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
301 | base, ext = os.path.splitext(b) |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
302 | if ext == ".exe": |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
303 | basesList.append(base) |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
304 | else: |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
305 | basesList.append(b) |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
306 | |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
307 | basesList.insert(0, "") |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
308 | currentText = self.basenameCombo.currentText() |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
309 | self.basenameCombo.clear() |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
310 | self.basenameCombo.addItems(basesList) |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
311 | self.basenameCombo.setEditText(currentText) |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
312 | |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
313 | d = QDir(os.path.join(modpath, "initscripts")) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
314 | initList = d.entryList(["*.py"]) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
315 | initList.insert(0, "") |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
316 | currentText = self.initscriptCombo.currentText() |
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
317 | self.initscriptCombo.clear() |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
318 | self.initscriptCombo.addItems([os.path.splitext(i)[0] for i in initList]) |
47
986f27beaad4
Py2 compatibility, freeze script based on project language, filedialog for icons, some PEP8.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
43
diff
changeset
|
319 | self.initscriptCombo.setEditText(currentText) |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
320 | |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
321 | @pyqtSlot(int) |
56
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
322 | def on_fileOrFolderList_currentRowChanged(self, row): |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
323 | """ |
64
c878aac7d3f5
Fixed code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
61
diff
changeset
|
324 | Private slot to handle the currentRowChanged signal of the |
c878aac7d3f5
Fixed code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
61
diff
changeset
|
325 | fileOrFolderList. |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
326 | |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
327 | @param row the current row |
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
328 | @type int |
56
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
329 | """ |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
330 | self.deleteSelectedButton.setEnabled(row != -1) |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
331 | if row != -1: |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
332 | self.fileOrFolderList.setCurrentRow(row) |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
333 | |
56
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
334 | @pyqtSlot(QListWidgetItem) |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
335 | def on_fileOrFolderList_itemDoubleClicked(self, itm): |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
336 | """ |
64
c878aac7d3f5
Fixed code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
61
diff
changeset
|
337 | Private slot to handle the itemDoubleClicked signal of the |
c878aac7d3f5
Fixed code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
61
diff
changeset
|
338 | fileOrFolderList. |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
339 | |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
340 | @param itm the selected row |
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
341 | @type QListWidgetItem |
56
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
342 | """ |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
343 | self.fileOrFolderEdit.setText(itm.text()) |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
344 | row = self.fileOrFolderList.currentRow() |
57
ddf3165e3d62
Some changes to the changes sent by Tobias.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
56
diff
changeset
|
345 | itm = self.fileOrFolderList.takeItem(row) |
ddf3165e3d62
Some changes to the changes sent by Tobias.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
56
diff
changeset
|
346 | del itm |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
347 | |
56
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
348 | @pyqtSlot() |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
349 | def on_addFileOrFolderButton_clicked(self): |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
350 | """ |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
351 | Private slot to add the entered file or directory to the list view. |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
352 | """ |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
353 | txt = self.fileOrFolderEdit.text() |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
354 | if txt: |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
355 | self.fileOrFolderList.addItem(txt) |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
356 | self.fileOrFolderEdit.clear() |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
357 | row = self.fileOrFolderList.currentRow() |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
358 | self.on_fileOrFolderList_currentRowChanged(row) |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
359 | |
56
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
360 | @pyqtSlot(str) |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
361 | def on_fileOrFolderEdit_textChanged(self, txt): |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
362 | """ |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
363 | Private slot to handle the textChanged signal of the directory edit. |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
364 | |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
365 | @param txt the text of the directory edit |
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
366 | @type str |
56
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
367 | """ |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
368 | self.addFileOrFolderButton.setEnabled(txt != "") |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
369 | |
56
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
370 | @pyqtSlot() |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
371 | def on_deleteSelectedButton_clicked(self): |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
372 | """ |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
373 | Private slot to delete the selected entry from the list view. |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
374 | """ |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
375 | row = self.fileOrFolderList.currentRow() |
57
ddf3165e3d62
Some changes to the changes sent by Tobias.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
56
diff
changeset
|
376 | itm = self.fileOrFolderList.takeItem(row) |
ddf3165e3d62
Some changes to the changes sent by Tobias.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
56
diff
changeset
|
377 | del itm |
56
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
378 | row = self.fileOrFolderList.currentRow() |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
379 | self.on_fileOrFolderList_currentRowChanged(row) |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
380 | |
56
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
381 | @pyqtSlot() |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
382 | def on_selectFileOrFolderButton_clicked(self): |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
383 | """ |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
384 | Private slot to select files or folders. |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
385 | |
56
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
386 | It displays a file and directory selection dialog to |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
387 | select the files and directories which should be copied |
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
388 | into the distribution folder. |
56
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
389 | """ |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
390 | items = EricDirFileDialog.getOpenFileAndDirNames( |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
391 | self, self.tr("Select files and folders"), self.__project.getProjectPath() |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
392 | ) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
393 | |
56
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
394 | for itm in items: |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
395 | itm = self.__project.getRelativePath(itm) |
56
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
396 | self.fileOrFolderList.addItem(Utilities.toNativeSeparators(itm)) |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
397 | row = self.fileOrFolderList.currentRow() |
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
398 | self.on_fileOrFolderList_currentRowChanged(row) |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
399 | |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
400 | def accept(self): |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
401 | """ |
102
78d1632d4b83
Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
97
diff
changeset
|
402 | Public method called by the Ok button. |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
403 | |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
404 | It saves the values in the parameters dictionary. |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
405 | """ |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
406 | # get data of general tab |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
407 | self.__parameters["targetDirectory"] = self.__project.getRelativePath( |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
408 | self.targetDirPicker.text() |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
409 | ) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
410 | self.__parameters["targetName"] = self.targetNameEdit.text() |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
411 | self.__parameters["baseName"] = self.basenameCombo.currentText() |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
412 | self.__parameters["initScript"] = self.initscriptCombo.currentText() |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
413 | self.__parameters["applicationIcon"] = self.__project.getRelativePath( |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
414 | self.applicationIconPicker.text() |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
415 | ) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
416 | self.__parameters["script"] = self.cxfreezeExecCombo.currentText() |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
417 | self.__parameters["keepPath"] = self.keeppathCheckBox.isChecked() |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
418 | self.__parameters["compress"] = self.compressCheckBox.isChecked() |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
419 | if self.nooptimizeRadioButton.isChecked(): |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
420 | self.__parameters["optimize"] = 0 |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
421 | elif self.optimizeRadioButton.isChecked(): |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
422 | self.__parameters["optimize"] = 1 |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
423 | else: |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
424 | self.__parameters["optimize"] = 2 |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
425 | |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
426 | # get data of advanced tab |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
427 | self.__parameters["defaultPath"] = self.__splitIt( |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
428 | self.defaultPathEdit.text(), os.pathsep |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
429 | ) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
430 | self.__parameters["includePath"] = self.__splitIt( |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
431 | self.includePathEdit.text(), os.pathsep |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
432 | ) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
433 | self.__parameters["replacePaths"] = self.__splitIt( |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
434 | self.replacePathsEdit.text(), os.pathsep |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
435 | ) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
436 | self.__parameters["includeModules"] = self.__splitIt( |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
437 | self.includeModulesEdit.text(), "," |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
438 | ) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
439 | self.__parameters["excludeModules"] = self.__splitIt( |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
440 | self.excludeModulesEdit.text(), "," |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
441 | ) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
442 | self.__parameters["extListFile"] = self.__project.getRelativePath( |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
443 | self.extListFilePicker.text() |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
444 | ) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
445 | |
56
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
446 | # get data of the additional files tab |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
447 | additionalFiles = [ |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
448 | self.fileOrFolderList.item(x).text() |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
449 | for x in range(self.fileOrFolderList.count()) |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
450 | ] |
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
451 | self.__parameters["additionalFiles"] = additionalFiles |
56
c8a47a8536b0
filedialog to add distribution dependent files, e.g. *.ui, readme, which are copied after the freeze process
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
49
diff
changeset
|
452 | |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
453 | # call the accept slot of the base class |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
454 | QDialog.accept(self) |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
455 | |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
456 | def __splitIt(self, s, sep): |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
457 | """ |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
458 | Private method to split a string observing various conditions. |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
459 | |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
460 | @param s string to split |
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
461 | @type str |
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
462 | @param sep separator string |
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
463 | @type str |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
464 | @return list of split values |
134
7880b294d1d1
Ported the plug-in to PyQt6 for eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
131
diff
changeset
|
465 | @rtype list of str |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
466 | """ |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
467 | if s == "" or s is None: |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
468 | return [] |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
469 | |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
470 | if s.endswith(sep): |
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
471 | s = s[:-1] |
139
4df5e67b084b
Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
136
diff
changeset
|
472 | |
1
0b6f3f5600da
Ported the cx_freeze plug-in to eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
473 | return s.split(sep) |