95 class Project(QObject): |
95 class Project(QObject): |
96 """ |
96 """ |
97 Class implementing the Django project support. |
97 Class implementing the Django project support. |
98 """ |
98 """ |
99 RecentApplicationsKey = "Django/RecentApplications" |
99 RecentApplicationsKey = "Django/RecentApplications" |
100 ## RecentTestLabelsKey = "Django/RecentTestLabels" |
|
101 ## RecentTestTagsKey = "Django/RecentTestTags" |
|
102 ## RecentTestExcludeTagsKey = "Django/RecentTestExcludeTags" |
|
103 |
100 |
104 def __init__(self, plugin, parent=None): |
101 def __init__(self, plugin, parent=None): |
105 """ |
102 """ |
106 Constructor |
103 Constructor |
107 |
104 |
2761 dlg = DjangoTestDataDialog(self, self.__ui) |
2758 dlg = DjangoTestDataDialog(self, self.__ui) |
2762 if dlg.exec_() == QDialog.Accepted: |
2759 if dlg.exec_() == QDialog.Accepted: |
2763 labels, pattern, tags, excludeTags, keep, reverse = \ |
2760 labels, pattern, tags, excludeTags, keep, reverse = \ |
2764 dlg.getData() |
2761 dlg.getData() |
2765 |
2762 |
2766 args = Utilities.parseOptionString(consoleCmd) |
2763 args = Utilities.parseOptionString(consoleCmd) |
2767 args[0] = Utilities.getExecutablePath(args[0]) |
2764 args[0] = Utilities.getExecutablePath(args[0]) |
2768 args.append(self.__getPythonExecutable()) |
2765 args.append(self.__getPythonExecutable()) |
2769 if deprecation: |
2766 if deprecation: |
2770 args.append("-Wall") |
2767 args.append("-Wall") |
2771 args.append("manage.py") |
2768 args.append("manage.py") |
2772 args.append("test") |
2769 args.append("test") |
2773 if pattern: |
2770 if pattern: |
2774 args.append("--pattern") |
2771 args.append("--pattern=" + pattern) |
2775 args.append(pattern) |
2772 for tag in tags: |
2776 for tag in tags: |
2773 args.append("--tag=" + tag) |
2777 args.append("--tag") |
2774 for tag in excludeTags: |
2778 args.append(tag) |
2775 args.append("--exclude-tag=" + tag) |
2779 for tag in excludeTags: |
2776 if keep: |
2780 args.append("--exclude-tag") |
2777 args.append("--keepdb") |
2781 args.append(tag) |
2778 if reverse: |
2782 if keep: |
2779 args.append("--reverse") |
2783 args.append("--keepdb") |
2780 args.extend(labels) |
2784 if reverse: |
2781 |
2785 args.append("--reverse") |
2782 self.__adjustWorkingDirectory(args, wd) |
2786 args.extend(labels) |
2783 started, pid = QProcess.startDetached(args[0], args[1:], wd) |
2787 |
2784 if not started: |
2788 self.__adjustWorkingDirectory(args, wd) |
2785 E5MessageBox.critical( |
2789 started, pid = QProcess.startDetached(args[0], args[1:], wd) |
2786 None, |
2790 if not started: |
2787 self.tr('Process Generation Error'), |
2791 E5MessageBox.critical( |
2788 self.tr('The Django process could not be started.')) |
2792 None, |
|
2793 self.tr('Process Generation Error'), |
|
2794 self.tr('The Django process could not be started.')) |
|
2795 |
2789 |
2796 def __runTestServer(self): |
2790 def __runTestServer(self): |
2797 """ |
2791 """ |
2798 Private slot to run a development server with data from a set of |
2792 Private slot to run a development server with data from a set of |
2799 fixtures. |
2793 fixtures. |