comparison mercurial/ui.py @ 31131:1613c55ad3d6

color: pass 'ui' to 'win32print' Same logic as before,'win32print' relies on some data we will move on the 'ui' object soon, we update the API beforehand for clarity.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Sun, 06 Nov 2016 20:10:53 +0100
parents 268caf97c38f
children f5131d4f512a
comparison
equal deleted inserted replaced
31130:268caf97c38f 31131:1613c55ad3d6
803 else: 803 else:
804 self._buffers[-1].extend(args) 804 self._buffers[-1].extend(args)
805 elif self._colormode == 'win32': 805 elif self._colormode == 'win32':
806 # windows color printing is its own can of crab, defer to 806 # windows color printing is its own can of crab, defer to
807 # the color module and that is it. 807 # the color module and that is it.
808 color.win32print(self._write, *args, **opts) 808 color.win32print(self, self._write, *args, **opts)
809 else: 809 else:
810 msgs = args 810 msgs = args
811 if self._colormode is not None: 811 if self._colormode is not None:
812 label = opts.get('label', '') 812 label = opts.get('label', '')
813 msgs = [self.label(a, label) for a in args] 813 msgs = [self.label(a, label) for a in args]
829 if self._bufferstates and self._bufferstates[-1][0]: 829 if self._bufferstates and self._bufferstates[-1][0]:
830 self.write(*args, **opts) 830 self.write(*args, **opts)
831 elif self._colormode == 'win32': 831 elif self._colormode == 'win32':
832 # windows color printing is its own can of crab, defer to 832 # windows color printing is its own can of crab, defer to
833 # the color module and that is it. 833 # the color module and that is it.
834 color.win32print(self._write_err, *args, **opts) 834 color.win32print(self, self._write_err, *args, **opts)
835 else: 835 else:
836 msgs = args 836 msgs = args
837 if self._colormode is not None: 837 if self._colormode is not None:
838 label = opts.get('label', '') 838 label = opts.get('label', '')
839 msgs = [self.label(a, label) for a in args] 839 msgs = [self.label(a, label) for a in args]