Mercurial > hg-stable
changeset 31105:75c4aafee490
color: clarify name of an argument of 'win32print'
In the current code, the function called to write happens to the 'orig' version
of the method calling 'win32print' (obtained with a 'super' call). However, the
variable could have a better name. That will be useful when we'll stop having
inheritance in play.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Fri, 24 Feb 2017 21:31:47 +0100 |
parents | 894bdcdc75df |
children | a2ee25ff75e5 |
files | mercurial/color.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/color.py Thu Feb 23 19:45:32 2017 +0100 +++ b/mercurial/color.py Fri Feb 24 21:31:47 2017 +0100 @@ -288,7 +288,7 @@ ansire = re.compile('\033\[([^m]*)m([^\033]*)(.*)', re.MULTILINE | re.DOTALL) - def win32print(text, orig, **opts): + def win32print(text, writefunc, **opts): label = opts.get('label', '') attr = origattr @@ -325,7 +325,7 @@ if sattr: attr = mapcolor(int(sattr), attr) _kernel32.SetConsoleTextAttribute(stdout, attr) - orig(m.group(2), **opts) + writefunc(m.group(2), **opts) m = re.match(ansire, m.group(3)) finally: # Explicitly reset original attributes