python:wxpython

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
次のリビジョン両方とも次のリビジョン
python:wxpython [2020/03/09 09:15] – [distutils.msvccompiler の get_build_version() の実装 (Python 3.8)] ともやんpython:wxpython [2020/03/09 09:18] – [distutils.msvc9compiler の find_vcvarsall() の実装] ともやん
行 254: 行 254:
 </WRAP> </WRAP>
  
-==== distutils.msvc9compiler の ====+==== distutils.msvc9compiler の find_vcvarsall() の実装 (Python 3.8) ====
 <WRAP prewrap 100% #result> <WRAP prewrap 100% #result>
 <code python> <code python>
 +def find_vcvarsall(version):
 +    """Find the vcvarsall.bat file
 +
 +    At first it tries to find the productdir of VS 2008 in the registry. If
 +    that fails it falls back to the VS90COMNTOOLS env var.
 +    """
 +    vsbase = VS_BASE % version
 +    try:
 +        productdir = Reg.get_value(r"%s\Setup\VC" % vsbase,
 +                                   "productdir")
 +    except KeyError:
 +        log.debug("Unable to find productdir in registry")
 +        productdir = None
 +
 +    if not productdir or not os.path.isdir(productdir):
 +        toolskey = "VS%0.f0COMNTOOLS" % version
 +        toolsdir = os.environ.get(toolskey, None)
 +
 +        if toolsdir and os.path.isdir(toolsdir):
 +            productdir = os.path.join(toolsdir, os.pardir, os.pardir, "VC")
 +            productdir = os.path.abspath(productdir)
 +            if not os.path.isdir(productdir):
 +                log.debug("%s is not a valid directory" % productdir)
 +                return None
 +        else:
 +            log.debug("Env var %s is not set or invalid" % toolskey)
 +    if not productdir:
 +        log.debug("No productdir found")
 +        return None
 +    vcvarsall = os.path.join(productdir, "vcvarsall.bat")
 +    if os.path.isfile(vcvarsall):
 +        return vcvarsall
 +    log.debug("Unable to find vcvarsall.bat")
 +    return None
 </code> </code>
 </WRAP> </WRAP>
  • python/wxpython.txt
  • 最終更新: 2021/06/12 12:32
  • by ともやん