10 from PyQt4.QtCore import Qt, QProcess |
10 from PyQt4.QtCore import Qt, QProcess |
11 from PyQt4.QtGui import QDialog, QListWidgetItem |
11 from PyQt4.QtGui import QDialog, QListWidgetItem |
12 |
12 |
13 from E5Gui import E5MessageBox |
13 from E5Gui import E5MessageBox |
14 |
14 |
15 from .Ui_DistributionTypeSelectionDialog import Ui_DistributionTypeSelectionDialog |
15 from .Ui_DistributionTypeSelectionDialog import \ |
|
16 Ui_DistributionTypeSelectionDialog |
16 |
17 |
17 import Preferences |
18 import Preferences |
18 |
19 |
19 |
20 |
20 class DistributionTypeSelectionDialog(QDialog, Ui_DistributionTypeSelectionDialog): |
21 class DistributionTypeSelectionDialog( |
|
22 QDialog, Ui_DistributionTypeSelectionDialog): |
21 """ |
23 """ |
22 Class implementing a dialog to select the distribution file formats. |
24 Class implementing a dialog to select the distribution file formats. |
23 """ |
25 """ |
24 def __init__(self, project, projectPath, parent=None): |
26 def __init__(self, project, projectPath, parent=None): |
25 """ |
27 """ |
26 Constructor |
28 Constructor |
27 |
29 |
28 @param project reference to the project object (ProjectPyramid.Project.Project) |
30 @param project reference to the project object |
|
31 (ProjectPyramid.Project.Project) |
29 @param projectPath path of the Pyramid project (string) |
32 @param projectPath path of the Pyramid project (string) |
30 @param parent reference to the parent widget (QWidget) |
33 @param parent reference to the parent widget (QWidget) |
31 """ |
34 """ |
32 super().__init__(parent) |
35 super().__init__(parent) |
33 self.setupUi(self) |
36 self.setupUi(self) |
50 Preferences.getSystem("IOEncoding"), |
53 Preferences.getSystem("IOEncoding"), |
51 'replace') |
54 'replace') |
52 else: |
55 else: |
53 if not finished: |
56 if not finished: |
54 errMsg = self.trUtf8( |
57 errMsg = self.trUtf8( |
55 "The python setup.py command did not finish within 30s.") |
58 "The python setup.py command did not finish within" |
|
59 " 30s.") |
56 else: |
60 else: |
57 errMsg = self.trUtf8("Could not start the pcreate executable.") |
61 errMsg = self.trUtf8("Could not start the pcreate executable.") |
58 if not errMsg: |
62 if not errMsg: |
59 for line in output.splitlines(): |
63 for line in output.splitlines(): |
60 line = line.strip() |
64 line = line.strip() |
61 if line.startswith("--formats="): |
65 if line.startswith("--formats="): |
62 format, description = line.replace("--formats=", "").split(None, 1) |
66 format, description = line.replace("--formats=", "")\ |
63 itm = QListWidgetItem("{0} ({1})".format(format, description), |
67 .split(None, 1) |
64 self.formatsList) |
68 itm = QListWidgetItem( |
|
69 "{0} ({1})".format(format, description), |
|
70 self.formatsList) |
65 itm.setFlags(itm.flags() | Qt.ItemIsUserCheckable) |
71 itm.setFlags(itm.flags() | Qt.ItemIsUserCheckable) |
66 itm.setCheckState(Qt.Unchecked) |
72 itm.setCheckState(Qt.Unchecked) |
67 else: |
73 else: |
68 E5MessageBox.critical(None, |
74 E5MessageBox.critical( |
|
75 None, |
69 self.trUtf8('Process Generation Error'), |
76 self.trUtf8('Process Generation Error'), |
70 errMsg) |
77 errMsg) |
71 |
78 |
72 def getFormats(self): |
79 def getFormats(self): |
73 """ |
80 """ |