ProjectDjango/Project.py

changeset 40
b793fc09d732
parent 38
3ce20c97fca9
child 47
19da3417eb3d
--- a/ProjectDjango/Project.py	Sun Feb 16 16:49:34 2014 +0100
+++ b/ProjectDjango/Project.py	Sun Feb 16 17:06:27 2014 +0100
@@ -104,8 +104,6 @@
         
         self.__recentApplications = []
         self.__loadRecentApplications()
-        
-        self.__djangoVersion = ""
     
     def initActions(self):
         """
@@ -1229,25 +1227,26 @@
         
         @return Django version (string)
         """
-        if not self.__djangoVersion:
-            args = ['--version']
-            ioEncoding = Preferences.getSystem("IOEncoding")
-            cmd = self.__getDjangoAdminCommand()
-            if isWindowsPlatform():
-                args.insert(0, cmd)
-                cmd = self.__getPythonExecutable()
-            
-            process = QProcess()
-            process.start(cmd, args)
-            procStarted = process.waitForStarted()
-            if procStarted:
-                finished = process.waitForFinished(30000)
-                if finished and process.exitCode() == 0:
-                    output = str(process.readAllStandardOutput(), ioEncoding,
-                                 'replace')
-                    self.__djangoVersion = output.splitlines()[0].strip()
+        djangoVersion = ""
+        
+        args = ['--version']
+        ioEncoding = Preferences.getSystem("IOEncoding")
+        cmd = self.__getDjangoAdminCommand()
+        if isWindowsPlatform():
+            args.insert(0, cmd)
+            cmd = self.__getPythonExecutable()
         
-        return self.__djangoVersion
+        process = QProcess()
+        process.start(cmd, args)
+        procStarted = process.waitForStarted()
+        if procStarted:
+            finished = process.waitForFinished(30000)
+            if finished and process.exitCode() == 0:
+                output = str(process.readAllStandardOutput(), ioEncoding,
+                             'replace')
+                djangoVersion = output.splitlines()[0].strip()
+        
+        return djangoVersion
     
     def __getApplications(self):
         """

eric ide

mercurial