Project/ProjectSourcesBrowser.py

branch
5_1_x
changeset 1493
876e068d632d
parent 950
1138e347c653
child 1510
e75ecf2bd9dd
equal deleted inserted replaced
1489:e647aa92e0ea 1493:876e068d632d
495 basename = os.path.splitext(fn)[0] 495 basename = os.path.splitext(fn)[0]
496 tbasename = os.path.splitext(tfn)[0] 496 tbasename = os.path.splitext(tfn)[0]
497 prEnable = prEnable or \ 497 prEnable = prEnable or \
498 os.path.isfile("{0}.profile".format(basename)) or \ 498 os.path.isfile("{0}.profile".format(basename)) or \
499 os.path.isfile("{0}.profile".format(tbasename)) 499 os.path.isfile("{0}.profile".format(tbasename))
500 coEnable = coEnable or \ 500 coEnable = (coEnable or \
501 os.path.isfile("{0}.coverage".format(basename)) or \ 501 os.path.isfile("{0}.coverage".format(basename)) or \
502 os.path.isfile("{0}.coverage".format(tbasename)) 502 os.path.isfile("{0}.coverage".format(tbasename))) and \
503 self.project.isPy3Project()
503 504
504 # now check the selected item 505 # now check the selected item
505 itm = self.model().item(self.currentIndex()) 506 itm = self.model().item(self.currentIndex())
506 fn = itm.fileName() 507 fn = itm.fileName()
507 if fn is not None: 508 if fn is not None:
508 basename = os.path.splitext(fn)[0] 509 basename = os.path.splitext(fn)[0]
509 prEnable = prEnable or \ 510 prEnable = prEnable or \
510 os.path.isfile("{0}.profile".format(basename)) 511 os.path.isfile("{0}.profile".format(basename))
511 coEnable = coEnable or \ 512 coEnable = (coEnable or \
512 os.path.isfile("{0}.coverage".format(basename)) 513 os.path.isfile("{0}.coverage".format(basename))) and \
514 itm.isPython3File()
513 515
514 self.profileMenuAction.setEnabled(prEnable) 516 self.profileMenuAction.setEnabled(prEnable)
515 self.coverageMenuAction.setEnabled(coEnable) 517 self.coverageMenuAction.setEnabled(coEnable)
516 518
517 self.showMenu.emit("Show", self.menuShow) 519 self.showMenu.emit("Show", self.menuShow)

eric ide

mercurial