Fixed an issue in isPy2File and isPy3File in the editor and refined the save as function when a project is open.

Thu, 21 Apr 2011 09:07:31 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 21 Apr 2011 09:07:31 +0200
changeset 994
8ed60a191a3a
parent 993
03493183dd91
child 996
5eddcfeb8948

Fixed an issue in isPy2File and isPy3File in the editor and refined the save as function when a project is open.

QScintilla/Editor.py file | annotate | diff | comparison | revisions
diff -r 03493183dd91 -r 8ed60a191a3a QScintilla/Editor.py
--- a/QScintilla/Editor.py	Sun Apr 17 19:57:43 2011 +0200
+++ b/QScintilla/Editor.py	Thu Apr 21 09:07:31 2011 +0200
@@ -1630,9 +1630,9 @@
                    self.project.isOpen() and \
                    self.project.isProjectFile(self.fileName):
                     return self.project.getProjectLanguage() in ["Python", "Python2"]
-            
-            if ext in self.dbs.getExtensions('Python2'):
-                return True
+                
+                if ext in self.dbs.getExtensions('Python2'):
+                    return True
         
         return False
 
@@ -1658,9 +1658,9 @@
                    self.project.isOpen() and \
                    self.project.isProjectFile(self.fileName):
                     return self.project.getProjectLanguage() in ["Python3"]
-            
-            if ext in self.dbs.getExtensions('Python3'):
-                return True
+                
+                if ext in self.dbs.getExtensions('Python3'):
+                    return True
         
         return False
 
@@ -2487,7 +2487,11 @@
             
             # save to project, if a project is loaded
             if self.project.isOpen():
-                path = self.project.getProjectPath()
+                if self.fileName is not None and \
+                   self.project.startswithProjectPath(self.fileName):
+                    path = os.path.dirname(self.fileName)
+                else:
+                    path = self.project.getProjectPath()
             
             if not path and self.fileName is not None:
                 path = os.path.dirname(self.fileName)

eric ide

mercurial