eric7/Project/ProjectSourcesBrowser.py

branch
unittest
changeset 9066
a219ade50f7c
parent 8881
54e42bc2437a
child 9072
8d3ae97ee666
equal deleted inserted replaced
9065:39405e6eba20 9066:a219ade50f7c
159 self.__startMenu.addAction( 159 self.__startMenu.addAction(
160 UI.PixmapCache.getIcon("coverageScript"), 160 UI.PixmapCache.getIcon("coverageScript"),
161 self.tr('Coverage run of Script...'), 161 self.tr('Coverage run of Script...'),
162 self.__contextMenuCoverageScript) 162 self.__contextMenuCoverageScript)
163 163
164 self.unittestAction = self.sourceMenu.addAction( 164 self.testingAction = self.sourceMenu.addAction(
165 self.tr('Run unittest...'), self.handleUnittest) 165 self.tr('Run tests...'), self.handleTesting)
166 self.sourceMenu.addSeparator() 166 self.sourceMenu.addSeparator()
167 act = self.sourceMenu.addAction( 167 act = self.sourceMenu.addAction(
168 self.tr('Rename file'), self._renameFile) 168 self.tr('Rename file'), self._renameFile)
169 self.menuActions.append(act) 169 self.menuActions.append(act)
170 act = self.sourceMenu.addAction( 170 act = self.sourceMenu.addAction(
644 if fn.endswith('.ptl'): 644 if fn.endswith('.ptl'):
645 for act in self.sourceMenuActions.values(): 645 for act in self.sourceMenuActions.values():
646 act.setEnabled(False) 646 act.setEnabled(False)
647 self.classDiagramAction.setEnabled(True) 647 self.classDiagramAction.setEnabled(True)
648 self.importsDiagramAction.setEnabled(True) 648 self.importsDiagramAction.setEnabled(True)
649 self.unittestAction.setEnabled(False) 649 self.testingAction.setEnabled(False)
650 self.checksMenu.menuAction().setEnabled( 650 self.checksMenu.menuAction().setEnabled(
651 False) 651 False)
652 elif fn.endswith('.rb'): 652 elif fn.endswith('.rb'):
653 # entry for mixed mode programs 653 # entry for mixed mode programs
654 for act in self.sourceMenuActions.values(): 654 for act in self.sourceMenuActions.values():
655 act.setEnabled(False) 655 act.setEnabled(False)
656 self.classDiagramAction.setEnabled(True) 656 self.classDiagramAction.setEnabled(True)
657 self.importsDiagramAction.setEnabled(False) 657 self.importsDiagramAction.setEnabled(False)
658 self.unittestAction.setEnabled(False) 658 self.testingAction.setEnabled(False)
659 self.checksMenu.menuAction().setEnabled( 659 self.checksMenu.menuAction().setEnabled(
660 False) 660 False)
661 elif fn.endswith('.js'): 661 elif fn.endswith('.js'):
662 # entry for mixed mode programs 662 # entry for mixed mode programs
663 for act in self.sourceMenuActions.values(): 663 for act in self.sourceMenuActions.values():
664 act.setEnabled(False) 664 act.setEnabled(False)
665 self.unittestAction.setEnabled(False) 665 self.testingAction.setEnabled(False)
666 self.checksMenu.menuAction().setEnabled( 666 self.checksMenu.menuAction().setEnabled(
667 False) 667 False)
668 self.graphicsMenu.menuAction().setEnabled( 668 self.graphicsMenu.menuAction().setEnabled(
669 False) 669 False)
670 else: 670 else:
671 # assume the source file is a Python file 671 # assume the source file is a Python file
672 for act in self.sourceMenuActions.values(): 672 for act in self.sourceMenuActions.values():
673 act.setEnabled(True) 673 act.setEnabled(True)
674 self.classDiagramAction.setEnabled(True) 674 self.classDiagramAction.setEnabled(True)
675 self.importsDiagramAction.setEnabled(True) 675 self.importsDiagramAction.setEnabled(True)
676 self.unittestAction.setEnabled(True) 676 self.testingAction.setEnabled(True)
677 self.checksMenu.menuAction().setEnabled( 677 self.checksMenu.menuAction().setEnabled(
678 True) 678 True)
679 self.sourceMenu.popup(self.mapToGlobal(coord)) 679 self.sourceMenu.popup(self.mapToGlobal(coord))
680 elif isinstance( 680 elif isinstance(
681 itm, 681 itm,

eric ide

mercurial