mercurial/color.py
changeset 34645 75979c8d4572
parent 34486 a57c938e7ac8
child 35181 d4805a5e7e70
equal deleted inserted replaced
34644:c0a6c19690ff 34645:75979c8d4572
   208     # If pager is active, color.pagermode overrides color.mode.
   208     # If pager is active, color.pagermode overrides color.mode.
   209     if getattr(ui, 'pageractive', False):
   209     if getattr(ui, 'pageractive', False):
   210         mode = ui.config('color', 'pagermode', mode)
   210         mode = ui.config('color', 'pagermode', mode)
   211 
   211 
   212     realmode = mode
   212     realmode = mode
   213     if pycompat.osname == 'nt':
   213     if pycompat.iswindows:
   214         from . import win32
   214         from . import win32
   215 
   215 
   216         term = encoding.environ.get('TERM')
   216         term = encoding.environ.get('TERM')
   217         # TERM won't be defined in a vanilla cmd.exe environment.
   217         # TERM won't be defined in a vanilla cmd.exe environment.
   218 
   218 
   377             msg = '\n'.join([_render_effects(ui, line, effects)
   377             msg = '\n'.join([_render_effects(ui, line, effects)
   378                              for line in msg.split('\n')])
   378                              for line in msg.split('\n')])
   379     return msg
   379     return msg
   380 
   380 
   381 w32effects = None
   381 w32effects = None
   382 if pycompat.osname == 'nt':
   382 if pycompat.iswindows:
   383     import ctypes
   383     import ctypes
   384 
   384 
   385     _kernel32 = ctypes.windll.kernel32
   385     _kernel32 = ctypes.windll.kernel32
   386 
   386 
   387     _WORD = ctypes.c_ushort
   387     _WORD = ctypes.c_ushort