Mercurial > hg
comparison hgext/color.py @ 31083:c42feb5f3143
color: move '_colormode' to the core 'ui' class
Having all 'ui' objects aware of 'color' allows us to update the core code to
handle color. The mode will stay 'None' in the default case so that will not
introduce any changes.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Mon, 20 Feb 2017 12:12:08 +0100 |
parents | 80f04ba7f4d1 |
children | 1482b57701ad |
comparison
equal
deleted
inserted
replaced
31082:abb92b3d370e | 31083:c42feb5f3143 |
---|---|
295 if always or (auto and formatted): | 295 if always or (auto and formatted): |
296 return realmode | 296 return realmode |
297 return None | 297 return None |
298 | 298 |
299 class colorui(uimod.ui): | 299 class colorui(uimod.ui): |
300 _colormode = None | |
301 def write(self, *args, **opts): | 300 def write(self, *args, **opts): |
302 if self._colormode is None: | 301 if self._colormode is None: |
303 return super(colorui, self).write(*args, **opts) | 302 return super(colorui, self).write(*args, **opts) |
304 | 303 |
305 label = opts.get('label', '') | 304 label = opts.get('label', '') |