Mercurial > public > mercurial-scm > hg
comparison mercurial/color.py @ 31089:a2ee25ff75e5
color: add multiple messages input support to 'win32print'
All other function doing writes support any number of input message. For
simplicity, we make 'win32print' able to do the same.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Fri, 24 Feb 2017 21:34:07 +0100 |
parents | 75c4aafee490 |
children | 8903f67b9ca8 |
comparison
equal
deleted
inserted
replaced
31088:75c4aafee490 | 31089:a2ee25ff75e5 |
---|---|
286 else: | 286 else: |
287 origattr = csbi.wAttributes | 287 origattr = csbi.wAttributes |
288 ansire = re.compile('\033\[([^m]*)m([^\033]*)(.*)', | 288 ansire = re.compile('\033\[([^m]*)m([^\033]*)(.*)', |
289 re.MULTILINE | re.DOTALL) | 289 re.MULTILINE | re.DOTALL) |
290 | 290 |
291 def win32print(text, writefunc, **opts): | 291 def win32print(writefunc, *msgs, **opts): |
292 for text in msgs: | |
293 _win32print(text, writefunc, **opts) | |
294 | |
295 def _win32print(text, writefunc, **opts): | |
292 label = opts.get('label', '') | 296 label = opts.get('label', '') |
293 attr = origattr | 297 attr = origattr |
294 | 298 |
295 def mapcolor(val, attr): | 299 def mapcolor(val, attr): |
296 if val == -1: | 300 if val == -1: |