QScintilla/Editor.py

changeset 994
8ed60a191a3a
parent 991
5ec5e707dfa5
child 1002
1151d1ea562a
equal deleted inserted replaced
993:03493183dd91 994:8ed60a191a3a
1628 if ext in [".py", ".pyw"] and \ 1628 if ext in [".py", ".pyw"] and \
1629 Preferences.getProject("DeterminePyFromProject") and \ 1629 Preferences.getProject("DeterminePyFromProject") and \
1630 self.project.isOpen() and \ 1630 self.project.isOpen() and \
1631 self.project.isProjectFile(self.fileName): 1631 self.project.isProjectFile(self.fileName):
1632 return self.project.getProjectLanguage() in ["Python", "Python2"] 1632 return self.project.getProjectLanguage() in ["Python", "Python2"]
1633 1633
1634 if ext in self.dbs.getExtensions('Python2'): 1634 if ext in self.dbs.getExtensions('Python2'):
1635 return True 1635 return True
1636 1636
1637 return False 1637 return False
1638 1638
1639 def isPy3File(self): 1639 def isPy3File(self):
1640 """ 1640 """
1656 if ext in [".py", ".pyw"] and \ 1656 if ext in [".py", ".pyw"] and \
1657 Preferences.getProject("DeterminePyFromProject") and \ 1657 Preferences.getProject("DeterminePyFromProject") and \
1658 self.project.isOpen() and \ 1658 self.project.isOpen() and \
1659 self.project.isProjectFile(self.fileName): 1659 self.project.isProjectFile(self.fileName):
1660 return self.project.getProjectLanguage() in ["Python3"] 1660 return self.project.getProjectLanguage() in ["Python3"]
1661 1661
1662 if ext in self.dbs.getExtensions('Python3'): 1662 if ext in self.dbs.getExtensions('Python3'):
1663 return True 1663 return True
1664 1664
1665 return False 1665 return False
1666 1666
1667 def isRubyFile(self): 1667 def isRubyFile(self):
1668 """ 1668 """
2485 if saveas or self.fileName is None: 2485 if saveas or self.fileName is None:
2486 saveas = True 2486 saveas = True
2487 2487
2488 # save to project, if a project is loaded 2488 # save to project, if a project is loaded
2489 if self.project.isOpen(): 2489 if self.project.isOpen():
2490 path = self.project.getProjectPath() 2490 if self.fileName is not None and \
2491 self.project.startswithProjectPath(self.fileName):
2492 path = os.path.dirname(self.fileName)
2493 else:
2494 path = self.project.getProjectPath()
2491 2495
2492 if not path and self.fileName is not None: 2496 if not path and self.fileName is not None:
2493 path = os.path.dirname(self.fileName) 2497 path = os.path.dirname(self.fileName)
2494 if path is None: 2498 if path is None:
2495 path = "" 2499 path = ""

eric ide

mercurial