Пример #1
0
    def setup_process_environment():
        env = QtCore.QProcessEnvironment()
        for k, v in os.environ.items():
            env.insert(k, v)

        s = Settings()

        PATH = ''
        if s.path_enabled:
            PATH = s.path

        if not s.vcvarsall:
            PATH = PATH + os.pathsep + os.environ['PATH']
        else:
            for k, v in msvc.get_vc_vars(s.vcvarsall,
                                         s.vcvarsall_arch).items():
                if k == 'PATH':
                    PATH = PATH + os.pathsep + v
                else:
                    env.insert(k, v)

        env.insert('PATH', PATH)

        _logger().debug('PATH=%s', PATH)

        if s.cob_config_dir_enabled and s.cob_config_dir:
            env.insert('COB_CONFIG_DIR', s.cob_config_dir)

        if s.cob_copy_dir_enabled and s.cob_copy_dir:
            env.insert('COB_COPY_DIR', s.cob_copy_dir)

        if s.cob_include_path_enabled and s.cob_copy_dir:
            env.insert('COB_INCLUDE_PATH', s.cob_include_path)

        if s.cob_lib_path and s.cob_copy_dir:
            env.insert('COB_LIB_PATH', s.cob_lib_path)

        return env