當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。