Mercurial > hg
changeset 11750:26e413f55b5e
hgcia/color: remove star imports
This plays nicer with demandimport and allows pyflakes to detect undefined
names.
author | Brodie Rao <brodie@bitheap.org> |
---|---|
date | Tue, 03 Aug 2010 13:02:11 -0400 |
parents | e627fef94604 |
children | b8b4a2417fbd |
files | hgext/color.py hgext/hgcia.py |
diffstat | 2 files changed, 23 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/color.py Tue Aug 03 13:59:14 2010 -0300 +++ b/hgext/color.py Tue Aug 03 13:02:11 2010 -0400 @@ -216,35 +216,36 @@ _('TYPE'))) try: - import re, pywintypes - from win32console import * + import re, pywintypes, win32console as win32c # http://msdn.microsoft.com/en-us/library/ms682088%28VS.85%29.aspx w32effects = { 'none': 0, 'black': 0, - 'red': FOREGROUND_RED, - 'green': FOREGROUND_GREEN, - 'yellow': FOREGROUND_RED | FOREGROUND_GREEN, - 'blue': FOREGROUND_BLUE, - 'magenta': FOREGROUND_BLUE | FOREGROUND_RED, - 'cyan': FOREGROUND_BLUE | FOREGROUND_GREEN, - 'white': FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE, - 'bold': FOREGROUND_INTENSITY, + 'red': win32c.FOREGROUND_RED, + 'green': win32c.FOREGROUND_GREEN, + 'yellow': win32c.FOREGROUND_RED | win32c.FOREGROUND_GREEN, + 'blue': win32c.FOREGROUND_BLUE, + 'magenta': win32c.FOREGROUND_BLUE | win32c.FOREGROUND_RED, + 'cyan': win32c.FOREGROUND_BLUE | win32c.FOREGROUND_GREEN, + 'white': (win32c.FOREGROUND_RED | win32c.FOREGROUND_GREEN | + win32c.FOREGROUND_BLUE), + 'bold': win32c.FOREGROUND_INTENSITY, 'black_background': 0, - 'red_background': BACKGROUND_RED, - 'green_background': BACKGROUND_GREEN, - 'yellow_background': BACKGROUND_RED | BACKGROUND_GREEN, - 'blue_background': BACKGROUND_BLUE, - 'purple_background': BACKGROUND_BLUE | BACKGROUND_RED, - 'cyan_background': BACKGROUND_BLUE | BACKGROUND_GREEN, - 'white_background': BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE, - 'bold_background': BACKGROUND_INTENSITY, - 'underline': COMMON_LVB_UNDERSCORE, # double-byte charsets only - 'inverse': COMMON_LVB_REVERSE_VIDEO, # double-byte charsets only + 'red_background': win32c.BACKGROUND_RED, + 'green_background': win32c.BACKGROUND_GREEN, + 'yellow_background': win32c.BACKGROUND_RED | win32c.BACKGROUND_GREEN, + 'blue_background': win32c.BACKGROUND_BLUE, + 'purple_background': win32c.BACKGROUND_BLUE | win32c.BACKGROUND_RED, + 'cyan_background': win32c.BACKGROUND_BLUE | win32c.BACKGROUND_GREEN, + 'white_background': (win32c.BACKGROUND_RED | win32c.BACKGROUND_GREEN | + win32c.BACKGROUND_BLUE), + 'bold_background': win32c.BACKGROUND_INTENSITY, + 'underline': win32c.COMMON_LVB_UNDERSCORE, # double-byte charsets only + 'inverse': win32c.COMMON_LVB_REVERSE_VIDEO, # double-byte charsets only } - stdout = GetStdHandle(STD_OUTPUT_HANDLE) + stdout = win32c.GetStdHandle(win32c.STD_OUTPUT_HANDLE) try: origattr = stdout.GetConsoleScreenBufferInfo()['Attributes'] except pywintypes.error:
--- a/hgext/hgcia.py Tue Aug 03 13:59:14 2010 -0300 +++ b/hgext/hgcia.py Tue Aug 03 13:02:11 2010 -0400 @@ -40,7 +40,7 @@ """ from mercurial.i18n import _ -from mercurial.node import * +from mercurial.node import bin, short from mercurial import cmdutil, patch, templater, util, mail import email.Parser