Changeset 1a31baf for waflib/ansiterm.py


Ignore:
Timestamp:
Mar 12, 2014, 2:02:47 AM (10 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
46b00690
Parents:
db21ca4
Message:

waf, waflib: update to 1.7.15

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waflib/ansiterm.py

    rdb21ca4 r1a31baf  
    77        if not(sys.stderr.isatty()and sys.stdout.isatty()):
    88                raise ValueError('not a tty')
    9         from ctypes import*
     9        from ctypes import Structure,windll,c_short,c_ushort,c_ulong,c_int,byref,POINTER,c_long,c_char
    1010        class COORD(Structure):
    1111                _fields_=[("X",c_short),("Y",c_short)]
     
    1616        class CONSOLE_CURSOR_INFO(Structure):
    1717                _fields_=[('dwSize',c_ulong),('bVisible',c_int)]
     18        windll.kernel32.GetStdHandle.argtypes=[c_ulong]
     19        windll.kernel32.GetStdHandle.restype=c_ulong
     20        windll.kernel32.GetConsoleScreenBufferInfo.argtypes=[c_ulong,POINTER(CONSOLE_SCREEN_BUFFER_INFO)]
     21        windll.kernel32.GetConsoleScreenBufferInfo.restype=c_long
     22        windll.kernel32.SetConsoleTextAttribute.argtypes=[c_ulong,c_ushort]
     23        windll.kernel32.SetConsoleTextAttribute.restype=c_long
     24        windll.kernel32.FillConsoleOutputCharacterA.argtypes=[c_ulong,c_char,c_ulong,POINTER(COORD),POINTER(c_ulong)]
     25        windll.kernel32.FillConsoleOutputCharacterA.restype=c_long
     26        windll.kernel32.FillConsoleOutputAttribute.argtypes=[c_ulong,c_ushort,c_ulong,POINTER(COORD),POINTER(c_ulong)]
     27        windll.kernel32.FillConsoleOutputAttribute.restype=c_long
     28        windll.kernel32.SetConsoleCursorPosition.argtypes=[c_ulong,POINTER(COORD)]
     29        windll.kernel32.SetConsoleCursorPosition.restype=c_long
     30        windll.kernel32.SetConsoleCursorInfo.argtypes=[c_ulong,POINTER(CONSOLE_CURSOR_INFO)]
     31        windll.kernel32.SetConsoleCursorInfo.restype=c_long
    1832        sbinfo=CONSOLE_SCREEN_BUFFER_INFO()
    1933        csinfo=CONSOLE_CURSOR_INFO()
     
    6074                                line_start=sbinfo.CursorPosition
    6175                                line_length=sbinfo.Size.X-sbinfo.CursorPosition.X
    62                         chars_written=c_int()
    63                         windll.kernel32.FillConsoleOutputCharacterA(self.hconsole,c_wchar(' '),line_length,line_start,byref(chars_written))
     76                        chars_written=c_ulong()
     77                        windll.kernel32.FillConsoleOutputCharacterA(self.hconsole,c_char(' '),line_length,line_start,byref(chars_written))
    6478                        windll.kernel32.FillConsoleOutputAttribute(self.hconsole,sbinfo.Attributes,line_length,line_start,byref(chars_written))
    6579                def clear_screen(self,param):
     
    7690                                clear_start=sbinfo.CursorPosition
    7791                                clear_length=((sbinfo.Size.X-sbinfo.CursorPosition.X)+sbinfo.Size.X*(sbinfo.Size.Y-sbinfo.CursorPosition.Y))
    78                         chars_written=c_int()
    79                         windll.kernel32.FillConsoleOutputCharacterA(self.hconsole,c_wchar(' '),clear_length,clear_start,byref(chars_written))
     92                        chars_written=c_ulong()
     93                        windll.kernel32.FillConsoleOutputCharacterA(self.hconsole,c_char(' '),clear_length,clear_start,byref(chars_written))
    8094                        windll.kernel32.FillConsoleOutputAttribute(self.hconsole,sbinfo.Attributes,clear_length,clear_start,byref(chars_written))
    8195                def push_cursor(self,param):
     
    128142                                else:
    129143                                        c=to_int(c,0)
    130                                 if c in range(30,38):
     144                                if 29<c<38:
    131145                                        attr=(attr&0xfff0)|self.rgb2bgr(c-30)
    132                                 elif c in range(40,48):
     146                                elif 39<c<48:
    133147                                        attr=(attr&0xff0f)|(self.rgb2bgr(c-40)<<4)
    134148                                elif c==0:
Note: See TracChangeset for help on using the changeset viewer.