本文整理匯總了Python中distutils.dist.help方法的典型用法代碼示例。如果您正苦於以下問題:Python dist.help方法的具體用法?Python dist.help怎麽用?Python dist.help使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類distutils.dist
的用法示例。
在下文中一共展示了dist.help方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _command_line_ok
# 需要導入模塊: from distutils import dist [as 別名]
# 或者: from distutils.dist import help [as 別名]
def _command_line_ok(_cache=None):
""" Return True if command line does not contain any
help or display requests.
"""
if _cache:
return _cache[0]
elif _cache is None:
_cache = []
ok = True
display_opts = ['--'+n for n in Distribution.display_option_names]
for o in Distribution.display_options:
if o[1]:
display_opts.append('-'+o[1])
for arg in sys.argv:
if arg.startswith('--help') or arg=='-h' or arg in display_opts:
ok = False
break
_cache.append(ok)
return ok
示例2: _command_line_ok
# 需要導入模塊: from distutils import dist [as 別名]
# 或者: from distutils.dist import help [as 別名]
def _command_line_ok(_cache=[]):
""" Return True if command line does not contain any
help or display requests.
"""
if _cache:
return _cache[0]
ok = True
display_opts = ['--'+n for n in Distribution.display_option_names]
for o in Distribution.display_options:
if o[1]:
display_opts.append('-'+o[1])
for arg in sys.argv:
if arg.startswith('--help') or arg=='-h' or arg in display_opts:
ok = False
break
_cache.append(ok)
return ok
示例3: test_show_help
# 需要導入模塊: from distutils import dist [as 別名]
# 或者: from distutils.dist import help [as 別名]
def test_show_help(self):
# smoke test, just makes sure some help is displayed
self.addCleanup(log.set_threshold, log._global_log.threshold)
dist = Distribution()
sys.argv = []
dist.help = 1
dist.script_name = 'setup.py'
with captured_stdout() as s:
dist.parse_command_line()
output = [line for line in s.getvalue().split('\n')
if line.strip() != '']
self.assertTrue(output)
示例4: test_show_help
# 需要導入模塊: from distutils import dist [as 別名]
# 或者: from distutils.dist import help [as 別名]
def test_show_help(self):
# smoke test, just makes sure some help is displayed
dist = Distribution()
sys.argv = []
dist.help = 1
dist.script_name = 'setup.py'
with captured_stdout() as s:
dist.parse_command_line()
output = [line for line in s.getvalue().split('\n')
if line.strip() != '']
self.assertTrue(len(output) > 0)
示例5: test_show_help
# 需要導入模塊: from distutils import dist [as 別名]
# 或者: from distutils.dist import help [as 別名]
def test_show_help(self):
# smoke test, just makes sure some help is displayed
dist = Distribution()
sys.argv = []
dist.help = 1
dist.script_name = 'setup.py'
with captured_stdout() as s:
dist.parse_command_line()
output = [line for line in s.getvalue().split('\n')
if line.strip() != '']
self.assertTrue(output)