Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 24 Feb 2017 19:28:45 +0100] rev 31092
ui: extract buffer write from protect and timed 'write_err' output
That subcall to 'self.write' is never doing actual write but only store things
in buffers. So we do not need to protect it for exception not to time its
execution.
This will make it easier to extract a '_write_err' function as we did for
'write'.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Mon, 20 Feb 2017 12:31:39 +0100] rev 31091
color: move 'write' logic to the core ui class
One more step, the support for writing color is not directly in core. No
behavior change for the default case ('_colormode' = None).
Here are the details of what we have to change to the core method:
* apply to 'self.label' to input in the buffered case
* dispatch to 'win32print' when applicable
* apply to 'self.label' to input when applicable
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 24 Feb 2017 19:27:00 +0100] rev 31090
ui: extract the low level part of 'write' in a dedicated function
We are about to add some extra logic related to color. That logic will need to
access the low level layer of ui doing the actual write to a stream. (eg:
'win32print'). We extract this logic into a private method for this purpose.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 24 Feb 2017 21:34:07 +0100] rev 31089
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.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 24 Feb 2017 21:31:47 +0100] rev 31088
color: clarify name of an argument of 'win32print'
In the current code, the function called to write happens to the 'orig' version
of the method calling 'win32print' (obtained with a 'super' call). However, the
variable could have a better name. That will be useful when we'll stop having
inheritance in play.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 23 Feb 2017 19:45:32 +0100] rev 31087
color: move the 'colorlabel' call to the core 'ui' class
This bring us closer to supporting color in core natively. Core already have a
'label' method that was a no-op. We update its to call the new 'colorlabel'
function. Behavior is unchanged when colormode = None.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 23 Feb 2017 19:10:24 +0100] rev 31086
color: move the 'colorlabel' function in the core module
The extract code is relocated in core.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 23 Feb 2017 19:00:26 +0100] rev 31085
color: extract the label code into its own function
We extract the logic into a function. This will allow us to move the logic into
the core 'color' module and later call it directly from core.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Mon, 20 Feb 2017 12:13:23 +0100] rev 31084
color: inline the 'showlabel' method
This function is quite simple and only have one call siteā¦ located a handful of line
under the definition. We inline the function for the sake of simplicity. One of
the motivation to do that now is that it reduce the amount of new method we
will have to add to the core 'ui' class for color support.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Mon, 20 Feb 2017 12:12:08 +0100] rev 31083
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.