7 Module implementing a dialog to enter the data for the 'dumpdata' command. |
7 Module implementing a dialog to enter the data for the 'dumpdata' command. |
8 """ |
8 """ |
9 |
9 |
10 import contextlib |
10 import contextlib |
11 |
11 |
12 from PyQt5.QtWidgets import QDialog |
12 from PyQt6.QtWidgets import QDialog |
13 |
13 |
14 from .Ui_DjangoDumpdataDataDialog import Ui_DjangoDumpdataDataDialog |
14 from .Ui_DjangoDumpdataDataDialog import Ui_DjangoDumpdataDataDialog |
15 |
15 |
16 |
16 |
17 class DjangoDumpdataDataDialog(QDialog, Ui_DjangoDumpdataDataDialog): |
17 class DjangoDumpdataDataDialog(QDialog, Ui_DjangoDumpdataDataDialog): |
21 def __init__(self, project, parent=None): |
21 def __init__(self, project, parent=None): |
22 """ |
22 """ |
23 Constructor |
23 Constructor |
24 |
24 |
25 @param project reference to the Django project object |
25 @param project reference to the Django project object |
26 @param parent reference to the parent widget (QWidget) |
26 @type Project |
|
27 @param parent reference to the parent widget |
|
28 @type QWidget |
27 """ |
29 """ |
28 super().__init__(parent) |
30 super().__init__(parent) |
29 self.setupUi(self) |
31 self.setupUi(self) |
30 |
32 |
31 self.__project = project |
33 self.__project = project |
46 |
48 |
47 def getData(self): |
49 def getData(self): |
48 """ |
50 """ |
49 Public method to get the data entered into the dialog. |
51 Public method to get the data entered into the dialog. |
50 |
52 |
51 @return tuple of two lists of strings, a string and an integer giving |
53 @return tuple giving the list of applications to work on, the list of |
52 the list of applications to work on, the list of applications to |
54 applications to exclude, the dump format and the indentation level |
53 exclude, the dump format and the indentation level |
55 @rtype tuple of (list of str, list of str, str, int) |
54 """ |
56 """ |
55 applStr = self.applicationsCombo.currentText() |
57 applStr = self.applicationsCombo.currentText() |
56 if applStr: |
58 if applStr: |
57 self.__project.setMostRecentApplication(applStr) |
59 self.__project.setMostRecentApplication(applStr) |
58 appls = applStr.split() |
60 appls = applStr.split() |