ProjectFlask/Project.py

changeset 61
fe1e8783a95f
parent 60
02243723ac17
child 64
0ee58185b8df
equal deleted inserted replaced
60:02243723ac17 61:fe1e8783a95f
40 @param iconSuffix suffix for the icons 40 @param iconSuffix suffix for the icons
41 @type str 41 @type str
42 @param parent parent 42 @param parent parent
43 @type QObject 43 @type QObject
44 """ 44 """
45 super(Project, self).__init__(parent) 45 super().__init__(parent)
46 46
47 self.__plugin = plugin 47 self.__plugin = plugin
48 self.__iconSuffix = iconSuffix 48 self.__iconSuffix = iconSuffix
49 self.__ui = parent 49 self.__ui = parent
50 50
391 if not venvName: 391 if not venvName:
392 venvName = self.__plugin.getPreferences( 392 venvName = self.__plugin.getPreferences(
393 "VirtualEnvironmentNamePy3") 393 "VirtualEnvironmentNamePy3")
394 else: 394 else:
395 venvName = "" 395 venvName = ""
396 if venvName: 396 virtEnv = (
397 virtEnv = self.__virtualEnvManager.getVirtualenvDirectory( 397 self.__virtualEnvManager.getVirtualenvDirectory(venvName)
398 venvName) 398 if venvName else
399 else: 399 ""
400 virtEnv = "" 400 )
401 401
402 if virtEnv and not os.path.exists(virtEnv): 402 if virtEnv and not os.path.exists(virtEnv):
403 virtEnv = "" 403 virtEnv = ""
404 404
405 return virtEnv # __IGNORE_WARNING_M834__ 405 return virtEnv # __IGNORE_WARNING_M834__
424 @type str 424 @type str
425 @return full command 425 @return full command
426 @rtype str 426 @rtype str
427 """ 427 """
428 virtualEnv = virtualEnvPath or self.getVirtualEnvironment() 428 virtualEnv = virtualEnvPath or self.getVirtualEnvironment()
429 if isWindowsPlatform(): 429 fullCmds = (
430 fullCmds = [ 430 [os.path.join(virtualEnv, "Scripts", command + '.exe'),
431 os.path.join(virtualEnv, "Scripts", command + '.exe'), 431 os.path.join(virtualEnv, "bin", command + '.exe'),
432 os.path.join(virtualEnv, "bin", command + '.exe'), 432 command] # fall back to just cmd
433 command # fall back to just cmd 433 if isWindowsPlatform() else
434 ] 434 [os.path.join(virtualEnv, "bin", command),
435 else: 435 os.path.join(virtualEnv, "local", "bin", command),
436 fullCmds = [ 436 Utilities.getExecutablePath(command),
437 os.path.join(virtualEnv, "bin", command), 437 command] # fall back to just cmd
438 os.path.join(virtualEnv, "local", "bin", command), 438 )
439 Utilities.getExecutablePath(command),
440 command # fall back to just cmd
441 ]
442 for command in fullCmds: 439 for command in fullCmds:
443 if os.path.exists(command): 440 if os.path.exists(command):
444 break 441 break
445 return command 442 return command
446 443

eric ide

mercurial