Bug fixes for better Python2 and Python3 support.

Tue, 26 Mar 2013 16:45:40 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 26 Mar 2013 16:45:40 +0100
changeset 39
94e448a362b2
parent 38
8db4afb551ed
child 40
293670f07b23

Bug fixes for better Python2 and Python3 support.

ChangeLog file | annotate | diff | comparison | revisions
PluginProjectPyramid.py file | annotate | diff | comparison | revisions
ProjectPyramid/Project.py file | annotate | diff | comparison | revisions
--- a/ChangeLog	Sat Feb 23 15:19:46 2013 +0100
+++ b/ChangeLog	Tue Mar 26 16:45:40 2013 +0100
@@ -1,5 +1,8 @@
 ChangeLog
 ---------
+Version 1.1.1
+- bug fixes
+
 Version 1.1.0
 - bug fixes
 - modified code to do lazy import
--- a/PluginProjectPyramid.py	Sat Feb 23 15:19:46 2013 +0100
+++ b/PluginProjectPyramid.py	Tue Mar 26 16:45:40 2013 +0100
@@ -26,7 +26,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "1.1.0"
+version = "1.1.1"
 className = "ProjectPyramidPlugin"
 packageName = "ProjectPyramid"
 shortDescription = "Project support for Pyramid projects."
--- a/ProjectPyramid/Project.py	Sat Feb 23 15:19:46 2013 +0100
+++ b/ProjectPyramid/Project.py	Tue Mar 26 16:45:40 2013 +0100
@@ -482,12 +482,23 @@
         python = "python"
         if isWindowsPlatform():
             python += ".exe"
+        else:
+            language = self.__e5project.getProjectLanguage()
+            if language == "Python3":
+                python = "python3"
+            elif language == "Python2":
+                python = "python2"
         virtualEnv = self.__getVirtualEnvironment()
         if virtualEnv:
             if isWindowsPlatform():
                 python = os.path.join(virtualEnv, "Scripts", python)
+                if not os.path.exists(python):
+                    python = os.path.join(virtualEnv, python)
             else:
                 python = os.path.join(virtualEnv, "bin", python)
+                if not os.path.exists(python):
+                    python = python[:-1]    # omit the version character
+        
         return python
     
     def __pyramidInfo(self):

eric ide

mercurial