ProjectDjango/Project.py

changeset 40
b793fc09d732
parent 38
3ce20c97fca9
child 47
19da3417eb3d
equal deleted inserted replaced
39:a438432399c0 40:b793fc09d732
102 self.__serverProc = None 102 self.__serverProc = None
103 self.__testServerProc = None 103 self.__testServerProc = None
104 104
105 self.__recentApplications = [] 105 self.__recentApplications = []
106 self.__loadRecentApplications() 106 self.__loadRecentApplications()
107
108 self.__djangoVersion = ""
109 107
110 def initActions(self): 108 def initActions(self):
111 """ 109 """
112 Public method to define the Django actions. 110 Public method to define the Django actions.
113 """ 111 """
1227 """ 1225 """
1228 Public method to get the Django version. 1226 Public method to get the Django version.
1229 1227
1230 @return Django version (string) 1228 @return Django version (string)
1231 """ 1229 """
1232 if not self.__djangoVersion: 1230 djangoVersion = ""
1233 args = ['--version'] 1231
1234 ioEncoding = Preferences.getSystem("IOEncoding") 1232 args = ['--version']
1235 cmd = self.__getDjangoAdminCommand() 1233 ioEncoding = Preferences.getSystem("IOEncoding")
1236 if isWindowsPlatform(): 1234 cmd = self.__getDjangoAdminCommand()
1237 args.insert(0, cmd) 1235 if isWindowsPlatform():
1238 cmd = self.__getPythonExecutable() 1236 args.insert(0, cmd)
1239 1237 cmd = self.__getPythonExecutable()
1240 process = QProcess() 1238
1241 process.start(cmd, args) 1239 process = QProcess()
1242 procStarted = process.waitForStarted() 1240 process.start(cmd, args)
1243 if procStarted: 1241 procStarted = process.waitForStarted()
1244 finished = process.waitForFinished(30000) 1242 if procStarted:
1245 if finished and process.exitCode() == 0: 1243 finished = process.waitForFinished(30000)
1246 output = str(process.readAllStandardOutput(), ioEncoding, 1244 if finished and process.exitCode() == 0:
1247 'replace') 1245 output = str(process.readAllStandardOutput(), ioEncoding,
1248 self.__djangoVersion = output.splitlines()[0].strip() 1246 'replace')
1249 1247 djangoVersion = output.splitlines()[0].strip()
1250 return self.__djangoVersion 1248
1249 return djangoVersion
1251 1250
1252 def __getApplications(self): 1251 def __getApplications(self):
1253 """ 1252 """
1254 Private method to ask the user for a list of application names. 1253 Private method to ask the user for a list of application names.
1255 1254

eric ide

mercurial