提交 cd2bfd20 编写于 作者: D Donald Stufft

Upgrade colorama to 0.3.9

上级 686ea382
Upgraded colorama to 0.3.9.
......@@ -3,5 +3,5 @@ from .initialise import init, deinit, reinit, colorama_text
from .ansi import Fore, Back, Style, Cursor
from .ansitowin32 import AnsiToWin32
__version__ = '0.3.7'
__version__ = '0.3.9'
......@@ -46,8 +46,8 @@ class AnsiToWin32(object):
sequences from the text, and if outputting to a tty, will convert them into
win32 function calls.
'''
ANSI_CSI_RE = re.compile('\001?\033\[((?:\d|;)*)([a-zA-Z])\002?') # Control Sequence Introducer
ANSI_OSC_RE = re.compile('\001?\033\]((?:.|;)*?)(\x07)\002?') # Operating System Command
ANSI_CSI_RE = re.compile('\001?\033\\[((?:\\d|;)*)([a-zA-Z])\002?') # Control Sequence Introducer
ANSI_OSC_RE = re.compile('\001?\033\\]((?:.|;)*?)(\x07)\002?') # Operating System Command
def __init__(self, wrapped, convert=None, strip=None, autoreset=False):
# The wrapped stream (normally sys.stdout or sys.stderr)
......
......@@ -83,9 +83,9 @@ else:
]
_FillConsoleOutputAttribute.restype = wintypes.BOOL
_SetConsoleTitleW = windll.kernel32.SetConsoleTitleA
_SetConsoleTitleW = windll.kernel32.SetConsoleTitleW
_SetConsoleTitleW.argtypes = [
wintypes.LPCSTR
wintypes.LPCWSTR
]
_SetConsoleTitleW.restype = wintypes.BOOL
......@@ -94,13 +94,15 @@ else:
STDERR: _GetStdHandle(STDERR),
}
def winapi_test():
handle = handles[STDOUT]
def _winapi_test(handle):
csbi = CONSOLE_SCREEN_BUFFER_INFO()
success = _GetConsoleScreenBufferInfo(
handle, byref(csbi))
return bool(success)
def winapi_test():
return any(_winapi_test(h) for h in handles.values())
def GetConsoleScreenBufferInfo(stream_id=STDOUT):
handle = handles[stream_id]
csbi = CONSOLE_SCREEN_BUFFER_INFO()
......
......@@ -3,7 +3,7 @@ distlib==0.2.4
distro==1.0.4
html5lib==1.0b10
six==1.10.0
colorama==0.3.7
colorama==0.3.9
CacheControl==0.12.2
msgpack-python==0.4.8
lockfile==0.12.2
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册