648 toolbarManager.addAction(self.coverageProjectAct, |
648 toolbarManager.addAction(self.coverageProjectAct, |
649 starttb.windowTitle()) |
649 starttb.windowTitle()) |
650 |
650 |
651 return [starttb, debugtb] |
651 return [starttb, debugtb] |
652 |
652 |
653 # TODO: accept history list |
|
654 def setArgvHistory(self, argsStr, clearHistories=False, history=None): |
653 def setArgvHistory(self, argsStr, clearHistories=False, history=None): |
655 """ |
654 """ |
656 Public slot to initialize the argv history. |
655 Public slot to initialize the argv history. |
657 |
656 |
658 @param argsStr the commandline arguments (string) |
657 @param argsStr the commandline arguments (string) |
659 @param clearHistories flag indicating, that the list should |
658 @param clearHistories flag indicating, that the list should |
660 be cleared (boolean) |
659 be cleared (boolean) |
661 @param history list of history entries to be set (list of strings) |
660 @param history list of history entries to be set (list of strings) |
662 """ |
661 """ |
663 if clearHistories: |
662 if clearHistories: |
664 self.argvHistory = [] |
663 del self.argvHistory[1:] |
|
664 elif history is not None: |
|
665 self.argvHistory = history[:] |
665 else: |
666 else: |
666 if argsStr in self.argvHistory: |
667 if argsStr in self.argvHistory: |
667 self.argvHistory.remove(argsStr) |
668 self.argvHistory.remove(argsStr) |
668 self.argvHistory.insert(0, argsStr) |
669 self.argvHistory.insert(0, argsStr) |
669 |
670 |
670 # TODO: accept history list |
|
671 def setWdHistory(self, wdStr, clearHistories=False, history=None): |
671 def setWdHistory(self, wdStr, clearHistories=False, history=None): |
672 """ |
672 """ |
673 Public slot to initialize the wd history. |
673 Public slot to initialize the wd history. |
674 |
674 |
675 @param wdStr the working directory (string) |
675 @param wdStr the working directory (string) |
676 @param clearHistories flag indicating, that the list should |
676 @param clearHistories flag indicating, that the list should |
677 be cleared (boolean) |
677 be cleared (boolean) |
678 @param history list of history entries to be set (list of strings) |
678 @param history list of history entries to be set (list of strings) |
679 """ |
679 """ |
680 if clearHistories: |
680 if clearHistories: |
681 self.wdHistory = [] |
681 del self.wdHistory[1:] |
|
682 elif history is not None: |
|
683 self.wdHistory = history[:] |
682 else: |
684 else: |
683 if wdStr in self.wdHistory: |
685 if wdStr in self.wdHistory: |
684 self.wdHistory.remove(wdStr) |
686 self.wdHistory.remove(wdStr) |
685 self.wdHistory.insert(0, wdStr) |
687 self.wdHistory.insert(0, wdStr) |
686 |
688 |
687 # TODO: accept history list |
|
688 def setEnvHistory(self, envStr, clearHistories=False, history=None): |
689 def setEnvHistory(self, envStr, clearHistories=False, history=None): |
689 """ |
690 """ |
690 Public slot to initialize the env history. |
691 Public slot to initialize the env history. |
691 |
692 |
692 @param envStr the environment settings (string) |
693 @param envStr the environment settings (string) |
693 @param clearHistories flag indicating, that the list should |
694 @param clearHistories flag indicating, that the list should |
694 be cleared (boolean) |
695 be cleared (boolean) |
695 @param history list of history entries to be set (list of strings) |
696 @param history list of history entries to be set (list of strings) |
696 """ |
697 """ |
697 if clearHistories: |
698 if clearHistories: |
698 self.envHistory = [] |
699 del self.envHistory[1:] |
|
700 elif history is not None: |
|
701 self.envHistory = history[:] |
699 else: |
702 else: |
700 if envStr in self.envHistory: |
703 if envStr in self.envHistory: |
701 self.envHistory.remove(envStr) |
704 self.envHistory.remove(envStr) |
702 self.envHistory.insert(0, envStr) |
705 self.envHistory.insert(0, envStr) |
703 |
706 |
704 def setExceptionReporting(self, exceptions): |
707 def setExceptionReporting(self, exceptions): |
705 """ |
708 """ |
706 Public slot to initialize the exception reporting flag. |
709 Public slot to initialize the exception reporting flag. |
707 |
710 |
1518 dlg = StartDialog( |
1521 dlg = StartDialog( |
1519 cap, self.argvHistory, self.wdHistory, |
1522 cap, self.argvHistory, self.wdHistory, |
1520 self.envHistory, self.exceptions, self.ui, 2, |
1523 self.envHistory, self.exceptions, self.ui, 2, |
1521 autoClearShell=self.autoClearShell) |
1524 autoClearShell=self.autoClearShell) |
1522 if dlg.exec_() == QDialog.Accepted: |
1525 if dlg.exec_() == QDialog.Accepted: |
1523 # TODO: get the complete histories |
1526 argv, wd, env, exceptions, clearShell, console = dlg.getData() |
1524 argv, wd, env, exceptions, clearShell, clearHistories, console = \ |
|
1525 dlg.getData() |
|
1526 eraseCoverage = dlg.getCoverageData() |
1527 eraseCoverage = dlg.getCoverageData() |
1527 |
1528 |
1528 if runProject: |
1529 if runProject: |
1529 fn = self.project.getMainScript(True) |
1530 fn = self.project.getMainScript(True) |
1530 if fn is None: |
1531 if fn is None: |
1566 self.lastDebuggedFile = fn |
1567 self.lastDebuggedFile = fn |
1567 self.restartAct.setEnabled(True) |
1568 self.restartAct.setEnabled(True) |
1568 |
1569 |
1569 # This moves any previous occurrence of these arguments to the head |
1570 # This moves any previous occurrence of these arguments to the head |
1570 # of the list. |
1571 # of the list. |
1571 # TODO: modify histories as retrieved |
1572 self.setArgvHistory(argv) |
1572 self.setArgvHistory(argv, clearHistories) |
1573 self.setWdHistory(wd) |
1573 self.setWdHistory(wd, clearHistories) |
1574 self.setEnvHistory(env) |
1574 self.setEnvHistory(env, clearHistories) |
|
1575 |
1575 |
1576 # Save the exception flags |
1576 # Save the exception flags |
1577 self.exceptions = exceptions |
1577 self.exceptions = exceptions |
1578 |
1578 |
1579 # Save the erase coverage flag |
1579 # Save the erase coverage flag |
1602 autoClearShell=self.autoClearShell, erase=eraseCoverage, |
1602 autoClearShell=self.autoClearShell, erase=eraseCoverage, |
1603 forProject=runProject, runInConsole=console, |
1603 forProject=runProject, runInConsole=console, |
1604 clientType=self.clientType) |
1604 clientType=self.clientType) |
1605 |
1605 |
1606 self.stopAct.setEnabled(True) |
1606 self.stopAct.setEnabled(True) |
1607 |
1607 |
|
1608 if dlg.clearHistories(): |
|
1609 self.setArgvHistory("", clearHistories=True) |
|
1610 self.setWdHistory("", clearHistories=True) |
|
1611 self.setEnvHistory("", clearHistories=True) |
|
1612 elif dlg.historiesModified(): |
|
1613 argvHistory, wdHistory, envHistory = dlg.getHistories() |
|
1614 self.setArgvHistory("", history=argvHistory) |
|
1615 self.setWdHistory("", history=wdHistory) |
|
1616 self.setEnvHistory("", history=envHistory) |
|
1617 |
1608 def __profileScript(self): |
1618 def __profileScript(self): |
1609 """ |
1619 """ |
1610 Private slot to handle the profile script action. |
1620 Private slot to handle the profile script action. |
1611 """ |
1621 """ |
1612 self.__doProfile(False) |
1622 self.__doProfile(False) |
1639 dlg = StartDialog( |
1649 dlg = StartDialog( |
1640 cap, self.argvHistory, self.wdHistory, self.envHistory, |
1650 cap, self.argvHistory, self.wdHistory, self.envHistory, |
1641 self.exceptions, self.ui, 3, |
1651 self.exceptions, self.ui, 3, |
1642 autoClearShell=self.autoClearShell) |
1652 autoClearShell=self.autoClearShell) |
1643 if dlg.exec_() == QDialog.Accepted: |
1653 if dlg.exec_() == QDialog.Accepted: |
1644 # TODO: get the complete histories |
1654 argv, wd, env, exceptions, clearShell, console = dlg.getData() |
1645 argv, wd, env, exceptions, clearShell, clearHistories, console = \ |
|
1646 dlg.getData() |
|
1647 eraseTimings = dlg.getProfilingData() |
1655 eraseTimings = dlg.getProfilingData() |
1648 |
1656 |
1649 if runProject: |
1657 if runProject: |
1650 fn = self.project.getMainScript(True) |
1658 fn = self.project.getMainScript(True) |
1651 if fn is None: |
1659 if fn is None: |
1687 self.lastDebuggedFile = fn |
1695 self.lastDebuggedFile = fn |
1688 self.restartAct.setEnabled(True) |
1696 self.restartAct.setEnabled(True) |
1689 |
1697 |
1690 # This moves any previous occurrence of these arguments to the head |
1698 # This moves any previous occurrence of these arguments to the head |
1691 # of the list. |
1699 # of the list. |
1692 # TODO: modify histories as retrieved |
1700 self.setArgvHistory(argv) |
1693 self.setArgvHistory(argv, clearHistories) |
1701 self.setWdHistory(wd) |
1694 self.setWdHistory(wd, clearHistories) |
1702 self.setEnvHistory(env) |
1695 self.setEnvHistory(env, clearHistories) |
|
1696 |
1703 |
1697 # Save the exception flags |
1704 # Save the exception flags |
1698 self.exceptions = exceptions |
1705 self.exceptions = exceptions |
1699 |
1706 |
1700 # Save the erase timing flag |
1707 # Save the erase timing flag |
1723 autoClearShell=self.autoClearShell, erase=eraseTimings, |
1730 autoClearShell=self.autoClearShell, erase=eraseTimings, |
1724 forProject=runProject, runInConsole=console, |
1731 forProject=runProject, runInConsole=console, |
1725 clientType=self.clientType) |
1732 clientType=self.clientType) |
1726 |
1733 |
1727 self.stopAct.setEnabled(True) |
1734 self.stopAct.setEnabled(True) |
1728 |
1735 |
|
1736 if dlg.clearHistories(): |
|
1737 self.setArgvHistory("", clearHistories=True) |
|
1738 self.setWdHistory("", clearHistories=True) |
|
1739 self.setEnvHistory("", clearHistories=True) |
|
1740 elif dlg.historiesModified(): |
|
1741 argvHistory, wdHistory, envHistory = dlg.getHistories() |
|
1742 self.setArgvHistory("", history=argvHistory) |
|
1743 self.setWdHistory("", history=wdHistory) |
|
1744 self.setEnvHistory("", history=envHistory) |
|
1745 |
1729 def __runScript(self): |
1746 def __runScript(self): |
1730 """ |
1747 """ |
1731 Private slot to handle the run script action. |
1748 Private slot to handle the run script action. |
1732 """ |
1749 """ |
1733 self.__doRun(False) |
1750 self.__doRun(False) |
1762 self.exceptions, self.ui, 1, |
1779 self.exceptions, self.ui, 1, |
1763 autoClearShell=self.autoClearShell, |
1780 autoClearShell=self.autoClearShell, |
1764 autoFork=self.forkAutomatically, |
1781 autoFork=self.forkAutomatically, |
1765 forkChild=self.forkIntoChild) |
1782 forkChild=self.forkIntoChild) |
1766 if dlg.exec_() == QDialog.Accepted: |
1783 if dlg.exec_() == QDialog.Accepted: |
1767 # TODO: get the complete histories |
1784 argv, wd, env, exceptions, clearShell, console = dlg.getData() |
1768 argv, wd, env, exceptions, clearShell, clearHistories, console = \ |
|
1769 dlg.getData() |
|
1770 forkAutomatically, forkIntoChild = dlg.getRunData() |
1785 forkAutomatically, forkIntoChild = dlg.getRunData() |
1771 |
1786 |
1772 if runProject: |
1787 if runProject: |
1773 fn = self.project.getMainScript(True) |
1788 fn = self.project.getMainScript(True) |
1774 if fn is None: |
1789 if fn is None: |
1810 self.lastDebuggedFile = fn |
1825 self.lastDebuggedFile = fn |
1811 self.restartAct.setEnabled(True) |
1826 self.restartAct.setEnabled(True) |
1812 |
1827 |
1813 # This moves any previous occurrence of these arguments to the head |
1828 # This moves any previous occurrence of these arguments to the head |
1814 # of the list. |
1829 # of the list. |
1815 # TODO: modify histories as retrieved |
1830 self.setArgvHistory(argv) |
1816 self.setArgvHistory(argv, clearHistories) |
1831 self.setWdHistory(wd) |
1817 self.setWdHistory(wd, clearHistories) |
1832 self.setEnvHistory(env) |
1818 self.setEnvHistory(env, clearHistories) |
|
1819 |
1833 |
1820 # Save the exception flags |
1834 # Save the exception flags |
1821 self.exceptions = exceptions |
1835 self.exceptions = exceptions |
1822 |
1836 |
1823 # Save the clear interpreter flag |
1837 # Save the clear interpreter flag |
1848 runInConsole=console, autoFork=forkAutomatically, |
1862 runInConsole=console, autoFork=forkAutomatically, |
1849 forkChild=forkIntoChild, clientType=self.clientType) |
1863 forkChild=forkIntoChild, clientType=self.clientType) |
1850 |
1864 |
1851 self.stopAct.setEnabled(True) |
1865 self.stopAct.setEnabled(True) |
1852 |
1866 |
|
1867 if dlg.clearHistories(): |
|
1868 self.setArgvHistory("", clearHistories=True) |
|
1869 self.setWdHistory("", clearHistories=True) |
|
1870 self.setEnvHistory("", clearHistories=True) |
|
1871 elif dlg.historiesModified(): |
|
1872 argvHistory, wdHistory, envHistory = dlg.getHistories() |
|
1873 self.setArgvHistory("", history=argvHistory) |
|
1874 self.setWdHistory("", history=wdHistory) |
|
1875 self.setEnvHistory("", history=envHistory) |
|
1876 |
1853 def __debugScript(self): |
1877 def __debugScript(self): |
1854 """ |
1878 """ |
1855 Private slot to handle the debug script action. |
1879 Private slot to handle the debug script action. |
1856 """ |
1880 """ |
1857 self.__doDebug(False) |
1881 self.__doDebug(False) |
1885 cap, self.argvHistory, self.wdHistory, self.envHistory, |
1909 cap, self.argvHistory, self.wdHistory, self.envHistory, |
1886 self.exceptions, self.ui, 0, tracePython=self.tracePython, |
1910 self.exceptions, self.ui, 0, tracePython=self.tracePython, |
1887 autoClearShell=self.autoClearShell, autoContinue=self.autoContinue, |
1911 autoClearShell=self.autoClearShell, autoContinue=self.autoContinue, |
1888 autoFork=self.forkAutomatically, forkChild=self.forkIntoChild) |
1912 autoFork=self.forkAutomatically, forkChild=self.forkIntoChild) |
1889 if dlg.exec_() == QDialog.Accepted: |
1913 if dlg.exec_() == QDialog.Accepted: |
1890 # TODO: get the complete histories |
1914 argv, wd, env, exceptions, clearShell, console = dlg.getData() |
1891 argv, wd, env, exceptions, clearShell, clearHistories, console = \ |
|
1892 dlg.getData() |
|
1893 tracePython, autoContinue, forkAutomatically, forkIntoChild = \ |
1915 tracePython, autoContinue, forkAutomatically, forkIntoChild = \ |
1894 dlg.getDebugData() |
1916 dlg.getDebugData() |
1895 |
1917 |
1896 if debugProject: |
1918 if debugProject: |
1897 fn = self.project.getMainScript(True) |
1919 fn = self.project.getMainScript(True) |
1935 self.lastDebuggedFile = fn |
1957 self.lastDebuggedFile = fn |
1936 self.restartAct.setEnabled(True) |
1958 self.restartAct.setEnabled(True) |
1937 |
1959 |
1938 # This moves any previous occurrence of these arguments to the head |
1960 # This moves any previous occurrence of these arguments to the head |
1939 # of the list. |
1961 # of the list. |
1940 # TODO: modify histories as retrieved |
1962 self.setArgvHistory(argv) |
1941 self.setArgvHistory(argv, clearHistories) |
1963 self.setWdHistory(wd) |
1942 self.setWdHistory(wd, clearHistories) |
1964 self.setEnvHistory(env) |
1943 self.setEnvHistory(env, clearHistories) |
|
1944 |
1965 |
1945 # Save the exception flags |
1966 # Save the exception flags |
1946 self.exceptions = exceptions |
1967 self.exceptions = exceptions |
1947 |
1968 |
1948 # Save the tracePython flag |
1969 # Save the tracePython flag |
1991 # Signal that we have started a debugging session |
2012 # Signal that we have started a debugging session |
1992 self.debuggingStarted.emit(fn) |
2013 self.debuggingStarted.emit(fn) |
1993 |
2014 |
1994 self.stopAct.setEnabled(True) |
2015 self.stopAct.setEnabled(True) |
1995 |
2016 |
|
2017 if dlg.clearHistories(): |
|
2018 self.setArgvHistory("", clearHistories=True) |
|
2019 self.setWdHistory("", clearHistories=True) |
|
2020 self.setEnvHistory("", clearHistories=True) |
|
2021 elif dlg.historiesModified(): |
|
2022 argvHistory, wdHistory, envHistory = dlg.getHistories() |
|
2023 self.setArgvHistory("", history=argvHistory) |
|
2024 self.setWdHistory("", history=wdHistory) |
|
2025 self.setEnvHistory("", history=envHistory) |
|
2026 |
1996 def __doRestart(self): |
2027 def __doRestart(self): |
1997 """ |
2028 """ |
1998 Private slot to handle the restart action to restart the last |
2029 Private slot to handle the restart action to restart the last |
1999 debugged file. |
2030 debugged file. |
2000 """ |
2031 """ |