本文整理汇总了Python中pip._vendor.progress.helpers.SHOW_CURSOR属性的典型用法代码示例。如果您正苦于以下问题:Python helpers.SHOW_CURSOR属性的具体用法?Python helpers.SHOW_CURSOR怎么用?Python helpers.SHOW_CURSOR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类pip._vendor.progress.helpers
的用法示例。
在下文中一共展示了helpers.SHOW_CURSOR属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: hidden_cursor
# 需要导入模块: from pip._vendor.progress import helpers [as 别名]
# 或者: from pip._vendor.progress.helpers import SHOW_CURSOR [as 别名]
def hidden_cursor(file):
# The Windows terminal does not support the hide/show cursor ANSI codes,
# even via colorama. So don't even try.
if WINDOWS:
yield
# We don't want to clutter the output with control characters if we're
# writing to a file, or if the user is running with --quiet.
# See https://github.com/pypa/pip/issues/3418
elif not file.isatty() or logger.getEffectiveLevel() > logging.INFO:
yield
else:
file.write(HIDE_CURSOR)
try:
yield
finally:
file.write(SHOW_CURSOR)
示例2: hidden_cursor
# 需要导入模块: from pip._vendor.progress import helpers [as 别名]
# 或者: from pip._vendor.progress.helpers import SHOW_CURSOR [as 别名]
def hidden_cursor(file):
# type: (IO) -> Iterator[None]
# The Windows terminal does not support the hide/show cursor ANSI codes,
# even via colorama. So don't even try.
if WINDOWS:
yield
# We don't want to clutter the output with control characters if we're
# writing to a file, or if the user is running with --quiet.
# See https://github.com/pypa/pip/issues/3418
elif not file.isatty() or logger.getEffectiveLevel() > logging.INFO:
yield
else:
file.write(HIDE_CURSOR)
try:
yield
finally:
file.write(SHOW_CURSOR)