Ejemplo n.º 1
0
def getVirtualEnvCandidates():
    """Return a list of strings which contains possible names
    of the virtualenv program for this environment.
    """
    if sys.version_info < (3, 0):
        virtualenv_candidates = [which('virtualenv'), which('virtualenv2')]
    else:
        virtualenv_candidates = [which('virtualenv'), which('virtualenv3')]

    return virtualenv_candidates
Ejemplo n.º 2
0
def getPipExecutable(venv_path):
    python_version = platform.python_version_tuple()
    if os.name == 'nt':
        int_directory = 'Scripts'
    else:
        int_directory = 'bin'
    pip_exe = which(os.path.join(venv_path, int_directory, 'pip' + python_version[0] + '.' + python_version[1]))
    return pip_exe
Ejemplo n.º 3
0
def getActivateScript(venv_path):
    if os.name == 'nt':
        int_directory = 'Scripts'
        suffix = '.bat'
    else:
        int_directory = 'bin'
        suffix = ''
    activate_script = which(os.path.join(venv_path, int_directory, 'activate' + suffix))
    return activate_script
    def testWizardToolChecks(self):
        pyside_rcc = which('pyside-rcc')
        pyside_uic = which('pyside-uic')
        options = {}
        options['lineEditPySideRCC'] = pyside_rcc
        options['lineEditPySideUIC'] = pyside_uic

        # Do some pretests on uic executable
        pyside_uic = options['lineEditPySideUIC']
        p = subprocess.Popen([pyside_uic, '--help'],
                             stdout=subprocess.PIPE,
                             stderr=subprocess.PIPE)
        stdout, stderr = p.communicate()
        if ((stdout and int(stdout) != 0)
                or not stdout) and 'SyntaxError' in stderr:
            # Try another executable
            pyside_uic = which('pyside-uic-py2')
            options['lineEditPySideUIC'] = pyside_uic

        c = WizardToolChecks(options)
        self.assertTrue(c.doCheck())
Ejemplo n.º 5
0
 def __init__(self):
     self._options = {}
     # Set default values
     self._options[SHOW_STEP_NAMES] = True
     self._options[DONT_CREATE_VIRTUAL_ENV] = False
     self._options[CHECK_TOOLS_ON_STARTUP] = True
     self._options[USE_EXTERNAL_GIT] = False
     self._options[PYSIDE_RCC_EXE] = getPySideRccExecutable()
     self._options[VIRTUAL_ENV_PATH] = getVirtEnvDirectory()
     self._options[GIT_EXE] = which('git')
     self._options[PREVIOUS_PW_WRITE_STEP_LOCATION] = ''
     self._options[PREVIOUS_PW_ICON_LOCATION] = ''
Ejemplo n.º 6
0
def repositoryIsUpToDate(location):
    result = True
    if isGitRepository(location):
        dvcs_cmd = which('git')
        if len(dvcs_cmd) > 0:
            process = Popen([dvcs_cmd[0], "status", location], stdout=PIPE, stderr=PIPE)
            outputs = process.communicate()
            stdout = outputs[0]
            stderr = outputs[1]
            if len(stdout) > 0 or len(stderr) > 0:
                result = False
        
    return result
Ejemplo n.º 7
0
 def __init__(self):
     # Set default values
     self._options = {
         SHOW_STEP_NAMES: True,
         DONT_CREATE_VIRTUAL_ENV: False,
         CHECK_TOOLS_ON_STARTUP: True,
         USE_EXTERNAL_GIT: False,
         USE_EXTERNAL_RCC: False,
         USE_EXTERNAL_UIC: False,
         VIRTUAL_ENV_PATH: get_virtualenv_directory(),
         GIT_EXE: which('git'),
         PYSIDE_RCC_EXE: INTERNAL_EXE,
         PYSIDE_UIC_EXE: INTERNAL_EXE,
         PREVIOUS_PW_WRITE_STEP_LOCATION: '',
         PREVIOUS_PW_ICON_LOCATION: '',
         INTERNAL_WORKFLOWS_AVAILABLE: False,
         INTERNAL_WORKFLOW_DIR: UNSET_FLAG,
         PREVIOUS_WORKFLOW: UNSET_FLAG,
         AUTOLOAD_PREVIOUS_WORKFLOW: True,
     }
Ejemplo n.º 8
0
def getPySideRccExecutable():
    if os.name == 'nt':
        pyside_rcc_directory = os.path.dirname(QtCore.__file__)
        pyside_rcc_potentials = [
            os.path.join(pyside_rcc_directory, 'pyside-rcc'), 'pyside-rcc'
        ]
    else:
        pyside_rcc_potentials = ['pyside-rcc']

    for pyside_rcc_potential in pyside_rcc_potentials:
        pyside_rcc = which(pyside_rcc_potential)
        if pyside_rcc is not None:
            p = subprocess.Popen([pyside_rcc, '-version'],
                                 stdout=subprocess.PIPE,
                                 stderr=subprocess.PIPE)
            _, stderr = p.communicate()
            return_code = p.returncode
            # pyside-rcc returns 1 for all program executions that don't actually compile resources.
            if return_code == 1 and 'Resource Compiler for Qt version' in stderr.decode(
                    'utf-8'):
                return pyside_rcc

    return None
def determinePysideURccExecutable():
    pyside_rcc_potentials = ['pyside-rcc']
    return which(pyside_rcc_potentials[0])