##// END OF EJS Templates
color: turn colorui functions into forwards when color is None...
Siddharth Agarwal -
r19072:b7b50a54 stable
parent child Browse files
Show More
@@ -317,6 +317,9 b' def configstyles(ui):'
317 317
318 318 class colorui(uimod.ui):
319 319 def popbuffer(self, labeled=False):
320 if self._colormode is None:
321 return super(colorui, self).popbuffer(labeled)
322
320 323 if labeled:
321 324 return ''.join(self.label(a, label) for a, label
322 325 in self._buffers.pop())
@@ -324,6 +327,9 b' class colorui(uimod.ui):'
324 327
325 328 _colormode = 'ansi'
326 329 def write(self, *args, **opts):
330 if self._colormode is None:
331 return super(colorui, self).write(*args, **opts)
332
327 333 label = opts.get('label', '')
328 334 if self._buffers:
329 335 self._buffers[-1].extend([(str(a), label) for a in args])
@@ -335,6 +341,9 b' class colorui(uimod.ui):'
335 341 *[self.label(str(a), label) for a in args], **opts)
336 342
337 343 def write_err(self, *args, **opts):
344 if self._colormode is None:
345 return super(colorui, self).write_err(*args, **opts)
346
338 347 label = opts.get('label', '')
339 348 if self._colormode == 'win32':
340 349 for a in args:
@@ -344,6 +353,9 b' class colorui(uimod.ui):'
344 353 *[self.label(str(a), label) for a in args], **opts)
345 354
346 355 def label(self, msg, label):
356 if self._colormode is None:
357 return super(colorui, self).label(msg, label)
358
347 359 effects = []
348 360 for l in label.split():
349 361 s = _styles.get(l, '')
General Comments 0
You need to be logged in to leave comments. Login now