diff hgext/color.py @ 31095:b4cb86ab4c71

color: drop the 'colorui' class Now that all logics formally bared by 'colorui' have been moved to the main ui class, that class is empty and can be dropped. As a nice side effect we can get rid of the baroque Initialization associated to it. There was much rejoicing.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Mon, 20 Feb 2017 12:42:35 +0100
parents 0c003943134f
children 8903f67b9ca8
line wrap: on
line diff
--- a/hgext/color.py	Mon Feb 20 12:42:23 2017 +0100
+++ b/hgext/color.py	Mon Feb 20 12:42:35 2017 +0100
@@ -296,18 +296,12 @@
         return realmode
     return None
 
-class colorui(uimod.ui):
-    pass
-
 def uisetup(ui):
     if ui.plain():
         return
-    if not isinstance(ui, colorui):
-        colorui.__bases__ = (ui.__class__,)
-        ui.__class__ = colorui
     def colorcmd(orig, ui_, opts, cmd, cmdfunc):
         mode = _modesetup(ui_, opts['color'])
-        colorui._colormode = mode
+        uimod.ui._colormode = mode
         if mode and mode != 'debug':
             color.configstyles(ui_)
         return orig(ui_, opts, cmd, cmdfunc)