当前位置: 首页>>代码示例>>Python>>正文


Python msvc9compiler.MSVCCompiler方法代码示例

本文整理汇总了Python中distutils.msvc9compiler.MSVCCompiler方法的典型用法代码示例。如果您正苦于以下问题:Python msvc9compiler.MSVCCompiler方法的具体用法?Python msvc9compiler.MSVCCompiler怎么用?Python msvc9compiler.MSVCCompiler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在distutils.msvc9compiler的用法示例。


在下文中一共展示了msvc9compiler.MSVCCompiler方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_remove_visual_c_ref

# 需要导入模块: from distutils import msvc9compiler [as 别名]
# 或者: from distutils.msvc9compiler import MSVCCompiler [as 别名]
def test_remove_visual_c_ref(self):
        from distutils.msvc9compiler import MSVCCompiler
        tempdir = self.mkdtemp()
        manifest = os.path.join(tempdir, 'manifest')
        f = open(manifest, 'w')
        try:
            f.write(_MANIFEST_WITH_MULTIPLE_REFERENCES)
        finally:
            f.close()

        compiler = MSVCCompiler()
        compiler._remove_visual_c_ref(manifest)

        # see what we got
        f = open(manifest)
        try:
            # removing trailing spaces
            content = '\n'.join([line.rstrip() for line in f.readlines()])
        finally:
            f.close()

        # makes sure the manifest was properly cleaned
        self.assertEqual(content, _CLEANED_MANIFEST) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:25,代码来源:test_msvc9compiler.py

示例2: _patch_for_embedding

# 需要导入模块: from distutils import msvc9compiler [as 别名]
# 或者: from distutils.msvc9compiler import MSVCCompiler [as 别名]
def _patch_for_embedding(patchlist):
    if sys.platform == 'win32':
        # we must not remove the manifest when building for embedding!
        from distutils.msvc9compiler import MSVCCompiler
        _patch_meth(patchlist, MSVCCompiler, '_remove_visual_c_ref',
                    lambda self, manifest_file: manifest_file)

    if sys.platform == 'darwin':
        # we must not make a '-bundle', but a '-dynamiclib' instead
        from distutils.ccompiler import CCompiler
        def my_link_shared_object(self, *args, **kwds):
            if '-bundle' in self.linker_so:
                self.linker_so = list(self.linker_so)
                i = self.linker_so.index('-bundle')
                self.linker_so[i] = '-dynamiclib'
            return old_link_shared_object(self, *args, **kwds)
        old_link_shared_object = _patch_meth(patchlist, CCompiler,
                                             'link_shared_object',
                                             my_link_shared_object) 
开发者ID:reBiocoder,项目名称:bioforum,代码行数:21,代码来源:recompiler.py

示例3: test_remove_visual_c_ref

# 需要导入模块: from distutils import msvc9compiler [as 别名]
# 或者: from distutils.msvc9compiler import MSVCCompiler [as 别名]
def test_remove_visual_c_ref(self):
        from distutils.msvc9compiler import MSVCCompiler
        tempdir = self.mkdtemp()
        manifest = os.path.join(tempdir, 'manifest')
        f = open(manifest, 'w')
        try:
            f.write(_MANIFEST)
        finally:
            f.close()

        compiler = MSVCCompiler()
        compiler._remove_visual_c_ref(manifest)

        # see what we got
        f = open(manifest)
        try:
            # removing trailing spaces
            content = '\n'.join([line.rstrip() for line in f.readlines()])
        finally:
            f.close()

        # makes sure the manifest was properly cleaned
        self.assertEqual(content, _CLEANED_MANIFEST) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:25,代码来源:test_msvc9compiler.py

示例4: test_remove_entire_manifest

# 需要导入模块: from distutils import msvc9compiler [as 别名]
# 或者: from distutils.msvc9compiler import MSVCCompiler [as 别名]
def test_remove_entire_manifest(self):
        from distutils.msvc9compiler import MSVCCompiler
        tempdir = self.mkdtemp()
        manifest = os.path.join(tempdir, 'manifest')
        f = open(manifest, 'w')
        try:
            f.write(_MANIFEST_WITH_ONLY_MSVC_REFERENCE)
        finally:
            f.close()

        compiler = MSVCCompiler()
        got = compiler._remove_visual_c_ref(manifest)
        self.assertIsNone(got) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:15,代码来源:test_msvc9compiler.py


注:本文中的distutils.msvc9compiler.MSVCCompiler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。