1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00
samba-mirror/python
Douglas Bagnall e58719d13c python/colour: add colourizing and switch functions
When samba.colour is first imported, the function

colour.c_BLUE("samba")

will give you the string "\033[1;34msamba\033[0m", which will show up
as blue on an ANSI terminal. If you then go:

colour.switch_colour_off()
colour.c_BLUE("samba")

the c_BLUE call will return the uncoloured string "samba".

This is so things like samba-tool can do this sort of thing:

    if not os.isatty(self.outf):
        switch_colour_off()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-05-31 01:57:17 +02:00
..
examples python/examples/winreg: two variable name typos on a single line 2017-03-10 07:31:10 +01:00
samba python/colour: add colourizing and switch functions 2018-05-31 01:57:17 +02:00
samba_external Move python modules from source4/scripting/python/ to python/. 2013-03-02 03:57:34 +01:00
modules.c python: Port simple libpython module to Python 3 compatible form 2017-06-13 22:46:14 +02:00
modules.h Move python modules from source4/scripting/python/ to python/. 2013-03-02 03:57:34 +01:00
py3compat.h python: Add compatability helpers to determine if type is really bytes 2018-03-23 07:28:25 +01:00
pyglue.c pyglue: Add function to generate a random byte string 2017-12-18 00:10:16 +01:00
wscript python/wscript: build grouping library for py2/py3 (--extra-python) 2018-04-13 07:27:12 +02:00