本文整理汇总了Python中distutils.command.config.config方法的典型用法代码示例。如果您正苦于以下问题:Python config.config方法的具体用法?Python config.config怎么用?Python config.config使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类distutils.command.config
的用法示例。
在下文中一共展示了config.config方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_clean
# 需要导入模块: from distutils.command import config [as 别名]
# 或者: from distutils.command.config import config [as 别名]
def test_clean(self):
# _clean removes files
tmp_dir = self.mkdtemp()
f1 = os.path.join(tmp_dir, 'one')
f2 = os.path.join(tmp_dir, 'two')
self.write_file(f1, 'xxx')
self.write_file(f2, 'xxx')
for f in (f1, f2):
self.assertTrue(os.path.exists(f))
pkg_dir, dist = self.create_dist()
cmd = config(dist)
cmd._clean(f1, f2)
for f in (f1, f2):
self.assertFalse(os.path.exists(f))
示例2: test_clean
# 需要导入模块: from distutils.command import config [as 别名]
# 或者: from distutils.command.config import config [as 别名]
def test_clean(self):
# _clean removes files
tmp_dir = self.mkdtemp()
f1 = os.path.join(tmp_dir, 'one')
f2 = os.path.join(tmp_dir, 'two')
self.write_file(f1, 'xxx')
self.write_file(f2, 'xxx')
for f in (f1, f2):
self.assertTrue(os.path.exists(f))
pkg_dir, dist = self.create_dist()
cmd = config(dist)
cmd._clean(f1, f2)
for f in (f1, f2):
self.assertTrue(not os.path.exists(f))
示例3: test_search_cpp
# 需要导入模块: from distutils.command import config [as 别名]
# 或者: from distutils.command.config import config [as 别名]
def test_search_cpp(self):
cmd = missing_compiler_executable(['preprocessor'])
if cmd is not None:
self.skipTest('The %r command is not found' % cmd)
pkg_dir, dist = self.create_dist()
cmd = config(dist)
cmd._check_compiler()
compiler = cmd.compiler
if sys.platform[:3] == "aix" and "xlc" in compiler.preprocessor[0].lower():
self.skipTest('xlc: The -E option overrides the -P, -o, and -qsyntaxonly options')
# simple pattern searches
match = cmd.search_cpp(pattern='xxx', body='/* xxx */')
self.assertEqual(match, 0)
match = cmd.search_cpp(pattern='_configtest', body='/* xxx */')
self.assertEqual(match, 1)
示例4: test_search_cpp
# 需要导入模块: from distutils.command import config [as 别名]
# 或者: from distutils.command.config import config [as 别名]
def test_search_cpp(self):
pkg_dir, dist = self.create_dist()
cmd = config(dist)
# simple pattern searches
match = cmd.search_cpp(pattern='xxx', body='/* xxx */')
self.assertEqual(match, 0)
match = cmd.search_cpp(pattern='_configtest', body='/* xxx */')
self.assertEqual(match, 1)
示例5: test_finalize_options
# 需要导入模块: from distutils.command import config [as 别名]
# 或者: from distutils.command.config import config [as 别名]
def test_finalize_options(self):
# finalize_options does a bit of transformation
# on options
pkg_dir, dist = self.create_dist()
cmd = config(dist)
cmd.include_dirs = 'one%stwo' % os.pathsep
cmd.libraries = 'one'
cmd.library_dirs = 'three%sfour' % os.pathsep
cmd.ensure_finalized()
self.assertEqual(cmd.include_dirs, ['one', 'two'])
self.assertEqual(cmd.libraries, ['one'])
self.assertEqual(cmd.library_dirs, ['three', 'four'])
示例6: test_search_cpp
# 需要导入模块: from distutils.command import config [as 别名]
# 或者: from distutils.command.config import config [as 别名]
def test_search_cpp(self):
if sys.platform == 'win32':
return
pkg_dir, dist = self.create_dist()
cmd = config(dist)
# simple pattern searches
match = cmd.search_cpp(pattern='xxx', body='// xxx')
self.assertEqual(match, 0)
match = cmd.search_cpp(pattern='_configtest', body='// xxx')
self.assertEqual(match, 1)
示例7: test_search_cpp
# 需要导入模块: from distutils.command import config [as 别名]
# 或者: from distutils.command.config import config [as 别名]
def test_search_cpp(self):
cmd = missing_compiler_executable(['preprocessor'])
if cmd is not None:
self.skipTest('The %r command is not found' % cmd)
pkg_dir, dist = self.create_dist()
cmd = config(dist)
# simple pattern searches
match = cmd.search_cpp(pattern='xxx', body='/* xxx */')
self.assertEqual(match, 0)
match = cmd.search_cpp(pattern='_configtest', body='/* xxx */')
self.assertEqual(match, 1)