Compare commits

...

81 commits

Author SHA1 Message Date
d20d094db0 fix(themes): use raw strings where applicable 2024-10-14 14:41:16 +02:00
49d0b98843 fix(tests): remove unit tests unable to handle raw strings 2024-10-14 14:33:09 +02:00
6a8fe89969 add clang theme 2024-01-29 22:31:13 +01:00
1bb4d60513 fix: end in an error if the asked resources is unknown 2023-07-10 18:25:40 +02:00
05c345f3a4 fix --resources [all]
Allow passing `-r` without argument to display all resources.

Ref: #81
Co-authored-by: tomasohara
2023-07-10 18:24:32 +02:00
1c07ace0e2 fix: do not chdir when looking for files
Allow relative paths for palettes and themes.

Refs: #114
Co-authored-by: FedericoStra
2023-06-28 21:02:09 +02:00
Konstantin Pavlov (ug)
292760c568 Fast commit 2023-06-28 20:44:29 +02:00
Konstantin Pavlov (ug)
b20fd4e18e Add theme for AMD/Xilinx Vivado tool 2023-06-28 20:44:29 +02:00
186dc04a86 adds a Catch2 theme 2023-04-07 16:12:05 +02:00
657a13eee1 feat(theme): add the Django theme
For coloring Django's logs.
2023-02-14 09:08:12 +01:00
6e623e897b feat(theme): add the SLURM theme
Coloring all known states with a consistent scheme.
2023-02-14 09:07:10 +01:00
0839d955a9 feat(latex): improve latex theme 2023-01-20 09:24:44 +01:00
4ca6429485 feat(cmake): improve cmake and ctest themes 2023-01-20 09:24:14 +01:00
6a490a483d fix logo display 2022-08-31 22:48:02 +02:00
88992390a5 Merge branch 'master' of github.com:nojhan/colout 2022-08-31 22:45:02 +02:00
86d26db948 add a logo 2022-08-31 22:44:29 +02:00
Johann Dreo
a41eea11d2 fix(syntax coloring): load all lexers, even those without aliases
Some Pygments’ lexers are registered without any alias, just with their long name.
This ensure that they are loaded, along with the others.
2022-05-12 12:00:11 +02:00
39660c001c Merge branch 'master' of github.com:nojhan/colout 2021-04-20 15:15:39 +02:00
438838dd4e
Merge pull request #110 from linkmauve/patch-1
Stop advertising python2 support
2020-08-02 09:43:02 +02:00
linkmauve
d9f1e69997
Stop advertising python2 support
python2 support got removed in dab5555503, this shouldn’t be advertised anymore.
2020-08-01 20:59:59 +02:00
3cbea0d66d Merge branch 'stdedos-master' 2020-06-04 09:55:44 +02:00
707f499f4a fix cmake theme
Do not match the ":" in CMake Error
2020-06-04 09:53:33 +02:00
Stavros Ntentos
01aedcc642 Prepare for new colout version
Because there is a weird `v0.11` tag, we pick the next version `v0.12.0`,
instead of the "real" next version aka `v0.7.0`

This project is considered to use Semantic Versioning (https://semver.org/)
(https://semver.org/spec/v2.0.0.html as of now)

Python versioning updates:
* Unify that package is offered for >=Python3.5
  2.7 support was dropped in dab5555503,
  and <3.5 versions do not exist in https://devguide.python.org/#status-of-python-branches as of committing time

* Add some classifiers (YMMV, my first pip package)
* Add some bare-bones `tox` configuration (YMMV, my first tox interaction)
* Add packages required for packaging/deployment in `requirements-build.txt`
* `README.md` is not required to be packaged anymore - it is read at install time
  * Fix Content-Type for PyPI

* Update `README.md`:
  * Reorder installation options (`pip` > `pipsi` > `ppa`)
  * Hard wrap at 100 chars for "meaningful" offences.
  * Add myself as maintainer
  * Remove escapes that don't make sense in CommonMark
    (GFM, as project is hosted in Github)
  * Fix typos

* Add a more complete `.gitignore` file
2020-06-03 00:56:32 +03:00
88b1770152 get back Dependencies section in README 2020-05-27 17:40:09 +02:00
e08d6ce0ad Merge branch 'stdedos-master' into develop 2020-05-27 17:38:46 +02:00
a682d3564e Merge branch 'master' of https://github.com/stdedos/colout into stdedos-master 2020-05-27 17:38:22 +02:00
437e241f2c
Merge pull request #107 from linkmauve/patch-1
Update colout.py to remove PY2 global
2020-05-17 17:38:47 +02:00
4e35011699
Merge pull request #98 from Code0x58/releases
Tests and release tweaks
2020-05-17 17:38:03 +02:00
linkmauve
dab5555503
Update colout.py
Python 2 will retire in thirteen days (see https://pythonclock.org/), there is no reason to keep obsolete checks in the code any longer.
2019-12-19 00:51:29 +01:00
Stavros Ntentos
70bec38546 Merge branch 'Code0x58-releases'
Closes #2

Conflicts:
	setup.py (PR #1 aka #102)

Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com>
2018-10-26 11:28:00 +03:00
Stavros Ntentos
f7b4b1de0c [Fix] No such file or directory: 'README.md'
Merge branch 'jquast-patch-1': Closes #1
2018-10-26 11:20:02 +03:00
Jeff Quast
6256b30582
this might help..
This should prevent the following error,

```
$ pip --version
pip 18.1 from /Users/jq/.pyenv/versions/3.6.5/envs/jupyter/lib/python3.6/site-packages/pip (python 3.6)
$ pip install colout
Collecting colout
  Downloading https://files.pythonhosted.org/packages/3d/ba/3ef31c0df3ace69271cc8b1af6b529f24de66ff42c0d99a8d18aa980a307/colout-0.5.tar.gz (47kB)
    100% |████████████████████████████████| 51kB 970kB/s
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/0x/y8s2qlk558596kyqdhv3nwv40000gn/T/pip-install-gixoekff/colout/setup.py", line 25, in <module>
        long_description=open('README.md').read(),
    FileNotFoundError: [Errno 2] No such file or directory: 'README.md'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/0x/y8s2qlk558596kyqdhv3nwv40000gn/T/pip-install-gixoekff/colout/
```
2018-10-07 23:40:47 -07:00
Oliver Bristow
b8e259add3
Make missing lexer error less verbose 2018-08-16 23:30:03 +01:00
Oliver Bristow
161777d679
Remove references to pygments+babel being optional 2018-08-16 23:30:03 +01:00
Oliver Bristow
3644dc0619
Fix error_codes scope + more informative lexer error 2018-08-16 23:28:22 +01:00
Oliver Bristow
7416655535
Remove references to pygments as optional 2018-08-16 23:28:22 +01:00
Oliver Bristow
b77d79e596
Mark python version support 2018-08-16 23:28:22 +01:00
Oliver Bristow
177a37dd37
Update documentation 2018-08-16 23:28:22 +01:00
Oliver Bristow
f9ec8cba39
Replace shell script with console scripts 2018-08-16 23:25:51 +01:00
Oliver Bristow
a7a5f6adb8
Publish universal wheel 2018-08-16 23:25:51 +01:00
Oliver Bristow
7e3502d667
Add another smoke test 2018-08-16 23:25:51 +01:00
Oliver Bristow
513552d5be
Remove 3.2 smoke test as incompatible syntax 2018-08-16 23:25:51 +01:00
Oliver Bristow
e49b42db45
Add 3.3 classifier 2018-08-16 23:25:51 +01:00
Oliver Bristow
b0d41ab172
Remove argparse requirement as code not 2.6 compatible 2018-08-16 23:25:51 +01:00
Oliver Bristow
7d848d09e8
Add package classifiers 2018-08-16 23:25:51 +01:00
Oliver Bristow
cfcd61fd2f
Add Travis smoke test 2018-08-16 23:25:51 +01:00
Oliver Bristow
a261a2dfa8
Use version from SCM 2018-08-16 23:25:51 +01:00
b62b57512d (almost) silently handle (weird) errors from pygments 2018-08-14 14:31:55 +02:00
b63b4177f9
Merge pull request #100 from kecsap/master
Update the PPA information
2018-08-11 22:36:29 +02:00
Csaba Kertesz
ae33bac9d7 Update the PPA information 2018-08-07 09:04:16 +03:00
9d87d38544
Merge pull request #97 from Code0x58/remove-six
Remove six
2018-08-04 19:05:38 +02:00
Oliver Bristow
80a55281c5
Remove six 2018-08-04 17:11:25 +01:00
78dc13c40e Add authors and a gdbinit example 2018-08-03 16:00:15 +02:00
7dbda565e9 Merge branch 'develop' of git://github.com/blastrock/colout into develop 2018-08-03 15:33:13 +02:00
cb790b3089 Merge branch 'tweaks' of git://github.com/Code0x58/colout into develop 2018-08-03 15:30:15 +02:00
Oliver Bristow
9d90694375
Only require argparse for python < 2.7 2018-08-02 12:55:03 +01:00
Oliver Bristow
d0ad9850ad
Remove use of six (not listed in dependencies) 2018-08-01 23:41:54 +01:00
Philippe Daouadi
a20cfa32c7 fix g++ coloration 2018-07-12 11:10:05 +02:00
abaa109c0d Add color/style pairs to the readme 2018-03-04 20:55:56 +01:00
1bebce1c63 version 0.6 2018-03-04 20:39:33 +01:00
0281609095 Merge branch 'fix-88-bug' of https://github.com/sirex/colout into sirex-fix-88-bug 2018-03-04 20:36:32 +01:00
4b758a5f9e Simpler color_map returns
Rename some variables/options.
Do not log debug context.
2018-02-27 16:29:19 +01:00
feb87f2532 fix separator option 2018-02-27 16:09:26 +01:00
b285d51db2 less verbose lexers debuging 2018-02-27 15:57:59 +01:00
8b0607e035 fix #92: handling of --colormap
Use "default" instead of "colormap".
Use the first color in the user-defined map to check mode.
Add check of mixed modes.
2018-02-27 15:51:41 +01:00
881a2c7cbd Add separator characters as options
Separator for lists of colors ("," -> sep_list).
Separator for fore/background color pairs ("." -> sep_back).
2018-02-27 09:09:33 +01:00
87cac38a48 Merge branch 'jason-green-io_background' into develop 2018-02-26 17:58:47 +01:00
d06b1b449a Allow background without foreground ("none.blue")
Use a configurable fore/background separator.
Declare fore- and background colors only once.
Pretty print context in debug mode.
2018-02-26 17:50:14 +01:00
34c04c49db Use six to handle both Py2 and Py3 on unicode 2018-02-26 16:28:42 +01:00
b284020355 Merge branch 'master' of https://github.com/jason-green-io/colout into jason-green-io_background 2018-02-26 15:57:53 +01:00
eca25b4106
Merge pull request #89 from jonathanpoelen/master
better perm theme
2018-02-26 15:54:31 +01:00
e9f0bff0cc
Merge pull request #85 from while0pass/master
fix UnicodeEncodeError
2018-02-26 15:50:28 +01:00
Jason Green
6001cf76ea fixed color 2017-10-20 21:30:43 -04:00
Jason Green
f34ac3b47f multiple styles at the same time and background colors using . eg. blue.yellow underline.blink 2017-10-20 21:10:28 -04:00
Jason Green
a47020e5d7 added the ability also specify background color in 8 color mode 2017-10-19 21:48:52 -04:00
Mantas
4a66a29761 Do not include whole licence text into licence field
In setup.py, licence field should be short licence abbreviation, not a full
licence text.
2017-06-23 12:57:05 +03:00
Mantas
b7e71fc32f Fixes #88: failed to install with pip
Also this fix includes package version issue, fixed in #87.

In order to generate python package with all the files in it, use this command:

    python setup.py sdist
2017-06-23 11:50:53 +03:00
ac7a2c3859 Merge branch 'master' of http://github.com/nojhan/colout 2017-05-17 11:13:25 +02:00
36faadae39 better themes for cmake, ctest and configure 2017-05-17 11:13:01 +02:00
jonathan poelen
eb8935f156 better perm theme 2017-02-22 23:38:06 +01:00
Nurono
5e1c64e61e fix UnicodeEncodeError 2016-11-23 12:48:09 +03:00
27 changed files with 1703 additions and 295 deletions

162
.gitignore vendored
View file

@ -1,4 +1,162 @@
*.pyc
## Python gitignore
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
colout.egg-info/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
## Jetbrains
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# Editor-based Rest Client
.idea/httpRequests
# SonarLint
.idea/sonarlint
# CMake
cmake-build-*/
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

12
.travis.yml Normal file
View file

@ -0,0 +1,12 @@
language: python
python:
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "pypy3"
install:
- pip install .
script:
- colout --help
- echo heyoo | colout hey yellow

1
MANIFEST.in Normal file
View file

@ -0,0 +1 @@
include LICENSE

238
README.md
View file

@ -1,13 +1,21 @@
colout(1) -- Color Up Arbitrary Command Output
==============================================
colout Color Up Arbitrary Command Output
==========================================
## SYNOPSIS
<p align="center">
<img
width="640"
src="https://raw.githubusercontent.com/nojhan/colout/master/colout_logo.svg"
alt="Colout logo"
/>
</p>
`colout` [-h] [-r RESOURCE]
## Synopsis
`colout` [-g] [-c] [-l min,max] [-a] [-t] [-T DIR] [-P DIR] [-d COLORMAP] [-s] [--debug] PATTERN [COLOR(S) [STYLE(S)]]
`colout [-h] [-r [RESOURCE]]`
## DESCRIPTION
`colout [-g] [-c] [-l min,max] [-a] [-t] [-T DIR] [-P DIR] [-d COLORMAP] [-s] [-e CHAR] [-E CHAR] [--debug] PATTERN [COLOR(S) [STYLE(S)]]`
## Description
`colout` read lines of text stream on the standard input and output characters
matching a given regular expression *PATTERN* in given *COLOR* and *STYLE*.
@ -25,9 +33,13 @@ rainbow, random, Random, Spectrum, spectrum, scale, Scale, hash, Hash, none, an
RGB hexadecimal triplet (`#11aaff`, for example) or any number between 0 and 255.
Available styles are: normal, bold, faint, italic, underline, blink,
rapid\_blink, reverse, conceal or random (some styles may have no effect, depending
rapid_blink, reverse, conceal or random (some styles may have no effect, depending
on your terminal).
In some case, you can indicate a foreground and a background color, by indicating both colors
separated by a period (for example: `red.blue`). You can also use this system to combine two styles
(for example, for a bold style that also blinks: `bold.blink`).
`rainbow` will cycle over a the default colormap at each matching pattern.
`Rainbow` will do the same over the default colormap for the 256-colors mode
(this requires a terminal that supports the 256 color escape sequences).
@ -52,10 +64,10 @@ Before interpreting the matched string as a number, colout will remove any
character not supposed to be used to write down numbers. This permits to apply
this special color on a large group, while interpreting only its numerical part.
If the python3-pygments library is installed, you can use the name of a
syntax-coloring "lexer" as a color (for example: "Cpp", "ruby", "xml+django", etc.).
You can use the name of a syntax-coloring ["lexer"](http://pygments.org/docs/lexers/)
as a color (for example: "Cpp", "ruby", "xml+django", etc.).
If GIMP palettes files (\*.gpl) are available, you can also use their names as a
If GIMP palettes files (*.gpl) are available, you can also use their names as a
colormap (see the `-P` switch below).
Note that the RGB colors (either the hex triplets or the palettes's colors) will
@ -66,8 +78,7 @@ When not specified, a *COLOR* defaults to _red_ and a *STYLE* defaults to _bold_
`colout` comes with some predefined themes to rapidly color well-known outputs
(see the `-t` switch below).
If the python3-pygments library is available, `colout` can be used as an interface
to it (see also the `-s` switch below).
`colout` can be used as an interface to pygments (see also the `--source` switch below).
To have a list of all colors, styles, special colormaps, themes, palettes and lexers,
use the `-r` switch (see below).
@ -75,37 +86,29 @@ use the `-r` switch (see below).
`colout` is released under the GNU Public License v3.
## INSTALLATION
## Installation
sudo python3 setup.py install
The recomended method is using pip to install the package for the local user:
and then soft link `/usr/local/bin/colout` to your colout.py under your installation
directory, which is usually something like
```console
$ pip install --user colout
```
/usr/local/lib/python3/dist-packages/colout-0.1-py3.egg/colout/colout.py
Another method is using [pipsi](https://github.com/mitsuhiko/pipsi)
(_pipsi is no longer maintained, <https://github.com/mitsuhiko/pipsi/blob/db3e3fccbe4f8f9ed1104ed7293ec8fec6579efc/README.md#L3>_)
```console
$ pipsi install colout
```
There is also a PPA for Ubuntu 16.04 (Xenial)/18.04 (Bionic) (@`0.6.1-3~dist7`, not actively maintained)
## OTHER INSTALLATION METHOD
```console
$ sudo add-apt-repository ppa:csaba-kertesz/random
$ sudo apt-get update
$ sudo apt-get/aptitude install colout
```
Pypi (the Python Package Index)
sudo pip install colout
or
sudo easy_install colout
Ubuntu 13.04's ppa
sudo add-apt-repository ppa:ciici123/colout
sudo apt-get update
sudo apt-get/aptitude install colout
Gentoo
sudo emerge colout
## OPTIONS
## Options
* `-h`, `--help`:
Show a help message and exit
@ -117,8 +120,8 @@ Gentoo
Use the given list of comma-separated colors as a colormap (cycle the colors at each match).
* `-l min,max`, `--scale min,max`:
When using the 'scale' colormap, parse matches as decimal numbers (taking your locale into account)
or as arithmetic expression (like "1+2/0.9\*3") and apply the rainbow colormap linearly
When using the 'scale' colormap, parse matches as decimal numbers (taking your locale into
account) or as arithmetic expression (like "1+2/0.9*3") and apply the rainbow colormap linearly
between the given min,max (0,100, by default).
* `-a`, `--all`:
@ -129,10 +132,10 @@ Gentoo
Interpret PATTERN as a predefined theme (perm, cmake, g++, etc.).
* `-T DIR`, `--themes-dir DIR`:
Search for additional themes (colout\_\*.py files) in this directory.
Search for additional themes (colout_*.py files) in this directory.
* `-P DIR`, `--palettes-dir DIR`:
Search for additional palettes (\*.gpl files) in this directory.
Search for additional palettes (*.gpl files) in this directory.
* `-d COLORMAP`, `--default COLORMAP`:
When using special colormaps (`random`, `scale` or `hash`), use this COLORMAP instead of the default one.
@ -142,21 +145,27 @@ Gentoo
Also, external palettes are converted from RGB to 256-ANSI and will thus not work if you use
them as default colormaps for a 8-colors mode special color.
* `-r TYPE(S)`, `--resources TYPE(S)`:
* `-r [TYPE(S)]`, `--resources [TYPE(S)]`:
Print the names of available resources. Use a comma-separated list of resources names
(styles, colors, special, themes, palettes, colormaps or lexers),
use 'all' to print everything.
use 'all' (or no argument) to print all resources.
* `-s`, `--source`:
Interpret PATTERN as source code readable by the Pygments library. If the first letter of PATTERN
is upper case, use the 256 color mode, if it is lower case, use the 8 colors mode.
In 256 color mode, interpret COLOR as a Pygments style (e.g. "default").
* `-e CHAR`, `--sep-list CHAR`:
Use this character as a separator for list of colors/resources/numbers (instead of comma).
* `-E CHAR`, `--sep-pair CHAR`:
Use this character as a separator for foreground/background pairs (instead of period).
* `--debug`:
Debug mode: print what's going on internally, if you want to check what features are available.
## REGULAR EXPRESSIONS
## Regular expressions
A regular expression (or _regex_) is a pattern that describes a set of strings
that matches it.
@ -166,25 +175,25 @@ that matches it.
special characters that would be recognize by your shell.
## DEPENDENCIES
## Dependencies
Recommended packages:
Necessary Python modules:
* `argparse` for a usable arguments parsing
* `pygments` for the source code syntax coloring
* `babel` for a locale-aware number parsing
## LIMITATIONS
## Limitations
Don't use nested groups or colout will duplicate the corresponding input text
with each matching colors.
Using a default colormap that is incompatible with the special colormap's mode
will end badly.
(i.e. number of colors) will end badly.
Color pairs (`foreground.background`) work in 8-colors mode for simple coloring, but may fail with `--colormap`.
## EXAMPLES
## Examples
### Simple
@ -194,7 +203,7 @@ will end badly.
* Color in bold violet home directories in _/etc/passwd_:
`colout '/home/[a-z]+' 135 < /etc/passwd`
* Color in yellow user/groups id, in bold green name and in bold red home directories in _/etc/passwd_:
* Color in yellow user/groups id, in bold green name and in bold red home directories in `/etc/passwd`:
`colout ':x:([0-9]+:[0-9]+):([^:]+).*(/home/[a-z]+)' yellow,green,red normal,bold < /etc/passwd`
* Color in yellow file permissions with read rights for everyone:
@ -258,38 +267,131 @@ will end badly.
The following bash function color the output of any command with the
cmake and g++ themes:
function cm()
{
set -o pipefail
$@ 2>&1 | colout -t cmake | colout -t g++
}
```bash
function cm()
{
set -o pipefail
$@ 2>&1 | colout -t cmake | colout -t g++
}
```
You then can use the `cm` alias as a prefix to your build command,
for example: `cm make test`
### GDB integration
You can use `colout` within the GNU debuger (`gbd`) to color its output.
For example, the following script `.gdbinit` configuration will color
the output of the backtrace command:
```gdb
set confirm off
# Don't wrap line or the coloring regexp won't work.
set width 0
# Create a named pipe to get outputs from gdb
shell test -e /tmp/coloutPipe && rm /tmp/coloutPipe
shell mkfifo /tmp/coloutPipe
define logging_on
# Instead of printing on stdout only, log everything...
set logging redirect on
# ... in our named pipe.
set logging on /tmp/coloutPipe
end
define logging_off
set logging off
set logging redirect off
# Because both gdb and our commands are writing on the same pipe at the same
# time, it is more than probable that gdb will end before our (higher level)
# commands. The gdb prompt will thus render before the result of the command,
# which is highly akward. To prevent this, we need to wait before displaying
# the prompt again. The more your commands are complex, the higher you will
# need to set this.
shell sleep 0.4s
end
define hook-backtrace
# Note: match path = [path]file[.ext] = (.*/)?(?:$|(.+?)(?:(\.[^.]*)|))
# This line color highlights:
# lines that link to source code,
# function call in green,
# arguments names in yellow, values in magenta,
# — the parent directory in bold red (assuming that the debug session would be in a "project/build/" directory).
shell cat /tmp/coloutPipe | colout "^(#)([0-9]+)\s+(0x\S+ )*(in )*(.*) (\(.*\)) (at) (.*/)?(?:$|(.+?)(?:(\.[^.]*)|)):([0-9]+)" red,red,blue,red,green,magenta,red,none,white,white,yellow normal,bold,normal,normal,normal,normal,normal,bold,bold,bold | colout "([\w\s]*?)(=)([^,]*?)([,\)])" yellow,blue,magenta,blue normal | colout "/($(basename $(dirname $(pwd))))/" red bold &
logging_on
end
define hookpost-backtrace
logging_off
end
# Don't forget to clean the adhoc pipe.
define hook-quit
set confirm off
shell rm -f /tmp/coloutPipe
end
```
Take a look at the `example.gdbinit` file distributed with colout for more gdb commands.
### Themes
You can easily add your own theme to colout.
A theme is basically a module with a function named `theme` that take the configuration context as an argument and
return back the (modified) context and a list of triplets.
A theme is basically a module with a function named `theme` that take the configuration context as
an argument and return back the (modified) context and a list of triplets.
Each triplet figures the same arguments than those of the command line interface.
def theme(context):
return context,[ [regexp, colors, styles] ]
```python
def theme(context):
return context,[ [regexp, colors, styles] ]
```
With the context dictionary at hand, you have access to the internal configuration of colout, you can thus change colormaps for
special keywords, the scale, even the available colors, styles or themes.
With the context dictionary at hand, you have access to the internal configuration of colout, you
can thus change colormaps for special keywords, the scale, even the available colors, styles or
themes.
See the cmake theme for how to modify an existing colormap if (and only if) the user didn't ask for an
alternative one.
See the ninja theme for how to extend an existing theme with more regexps and a different configuration.
See the cmake them for how to modify an existing colormap if (and only if) the user didn't ask for an alternative one.
See the ninja theme for how to extend an existing theme with more regexps and a different configuration.
See the gcc theme for an example of how to use the localization of existing softwares to build translated regexp.
### Buffering
Note that when you use colout within real time streams (like `tail -f X | qrep Y | colout Y`) of commands,
you may observe that the lines are printed by large chunks and not one by one, in real time.
Note that when you use colout within real time streams (like `tail -f X | grep Y | colout Z`) of
commands, you may observe that the lines are printed by large chunks and not one by one, in real
time.
This is not due to colout but to the buffering behavior of your shell.
To fix that, use `stdbuf`, for example: `tail -f X | stdbuf -o0 grep Y | colout Y`.
To fix that, use `stdbuf`, for example: `tail -f X | stdbuf -o0 grep Y | colout Z`.
## Authors
* nojhan <nojhan@nojhan.net>: original idea, main developer, maintainer.
* Adrian Sadłocha <adrian.adek@gmail.com>
* Alex Burka <aburka@seas.upenn.edu>
* Brian Foley <bpfoley@gmail.com>
* Charles Lewis <noodle@umich.edu>
* DainDwarf <daindwarf@gmail.com>
* Dimitri Merejkowsky <dmerejkowsky@aldebaran-robotics.com>
* Dong Wei Ming <ciici123@gmail.com>
* Fabien MARTY <fabien.marty@gmail.com>
* Jason Green <jason@green.io>
* John Anderson <sontek@gmail.com>
* Jonathan Poelen <jonathan.poelen@gmail.com>
* Louis-Kenzo Furuya Cahier <louiskenzo@gmail.com>
* Mantas <sirexas@gmail.com>
* Martin Ueding <dev@martin-ueding.de>
* Nicolas Pouillard <nicolas.pouillard@gmail.com>
* Nurono <while0pass@yandex.ru>
* Oliver Bristow <obristow@mintel.com>
* orzrd <61966225@qq.com>
* Philippe Daouadi <p.daouadi@free.fr>
* Piotr Staroszczyk <piotr.staroszczyk@get24.org>
* Scott Lawrence <oz@lindenlab.com>
* Xu Di <xudifsd@gmail.com>
* https://github.com/stdedos: maintainer.

View file

@ -1,11 +0,0 @@
#!/bin/bash
# Copyright (c) 2013 Martin Ueding <dev@martin-ueding.de>
# Small launcher script for the main module.
# Licence: GPL 3
set -e
set -u
python3 -m colout.colout "$@"

View file

@ -5,19 +5,22 @@
# Licensed under the GPL version 3
# 2012 (c) nojhan <nojhan@nojhan.net>
import sys
import re
import random
import os
import re
import sys
import copy
import glob
import math
import importlib
import logging
import pprint
import random
import signal
import string
import hashlib
import functools
import logging
import argparse
import importlib
import functools
import babel.numbers as bn
# set the SIGPIPE handler to kill the program instead of
# ending in a write error when a broken pipe occurs
@ -38,11 +41,23 @@ context["styles"] = {
"reverse": 7, "conceal": 8
}
# Available color names in 8-colors mode
context["colors"] = {
"black": 0, "red": 1, "green": 2, "yellow": 3, "orange":3, "blue": 4,
"magenta": 5, "purple": 5, "cyan": 6, "white": 7, "none": -1
}
error_codes = {"UnknownColor": 1, "DuplicatedPalette": 2, "MixedModes": 3, "UnknownLexer": 4, "UnknownResource": 5}
# Available color names in 8-colors mode.
eight_colors = ["black","red","green","yellow","blue","magenta","cyan","white"]
# Given in that order, the ASCII code is the index.
eight_color_codes = {n:i for i,n in enumerate(eight_colors)}
# One can add synonyms.
eight_color_codes["orange"] = eight_color_codes["yellow"]
eight_color_codes["purple"] = eight_color_codes["magenta"]
# Foreground colors has a special "none" item.
# Note: use copy to avoid having the same reference over fore/background.
context["colors"] = copy.copy(eight_color_codes)
context["colors"]["none"] = -1
# Background has the same colors than foreground, but without the none code.
context["backgrounds"] = copy.copy(eight_color_codes)
context["themes"] = {}
@ -78,6 +93,11 @@ context["scale"] = (0,100)
context["lexers"] = []
# Character use as a delimiter
# between foreground and background.
context["sep_pair"]="."
context["sep_list"]=","
class UnknownColor(Exception):
pass
@ -87,13 +107,27 @@ class DuplicatedPalette(Exception):
class DuplicatedTheme(Exception):
pass
class MixedModes(Exception):
pass
###############################################################################
# Ressource parsing helpers
###############################################################################
def make_colormap( colors, sep_list = context["sep_list"] ):
cmap = colors.split(sep_list)
def set_special_colormaps( cmap ):
# Check unicity of mode.
modes = [mode(c) for c in cmap]
if len(uniq(modes)) > 1:
# Format a list of color:mode, for error display.
raise MixedModes(", ".join(["%s:%s" % cm for cm in zip(cmap,modes)]))
return cmap
def set_special_colormaps( cmap, sep_list = context["sep_list"] ):
"""Change all the special colors to a single colormap (which must be a list of colors)."""
global context
context["colormaps"]["scale"] = cmap
@ -102,10 +136,10 @@ def set_special_colormaps( cmap ):
context["colormaps"]["Hash"] = cmap
context["colormaps"]["default"] = cmap
context["colormaps"]["Default"] = cmap
context["colormaps"]["random"] = cmap
context["colormaps"]["Random"] = cmap
context["colormaps"]["random"] = cmap
context["colormaps"]["Random"] = cmap
context["user_defined_colormaps"] = True
logging.debug("user-defined special colormap: %s" % ",".join([str(i) for i in cmap]) )
logging.debug("user-defined special colormap: %s" % sep_list.join([str(i) for i in cmap]) )
def parse_gimp_palette( filename ):
@ -143,7 +177,7 @@ def parse_gimp_palette( filename ):
palette = []
for line in lines:
# skip lines with only a comment
if re.match("^\s*#.*$", line ):
if re.match(r"^\s*#.*$", line ):
continue
# decode the columns-ths codes. Generally [R G B] followed by a comment
colors = [ int(c) for c in line.split()[:columns] ]
@ -215,13 +249,13 @@ def hex_to_rgb(h):
def load_themes( themes_dir):
global context
logging.debug("search for themes in: %s" % themes_dir)
os.chdir( themes_dir )
sys.path.append( themes_dir )
# load available themes
for f in glob.iglob("colout_*.py"):
module = ".".join(f.split(".")[:-1]) # remove extension
name = "_".join(module.split("_")[1:]) # remove the prefix
for f in glob.iglob(os.path.join(themes_dir, "colout_*.py")):
basename = os.path.basename(f) # Remove path.
module = os.path.splitext(basename)[0] # Remove extension.
name = "_".join(module.split("_")[1:]) # Remove the 'colout_' prefix.
if name in context["themes"]:
raise DuplicatedTheme(name)
logging.debug("load theme %s" % name)
@ -231,10 +265,9 @@ def load_themes( themes_dir):
def load_palettes( palettes_dir, ignore_duplicates = True ):
global context
logging.debug("search for palettes in: %s" % palettes_dir)
os.chdir( palettes_dir )
# load available colormaps (GIMP palettes format)
for p in glob.iglob("*.gpl"):
for p in glob.iglob(os.path.join(palettes_dir, "*.gpl")):
try:
name,palette = parse_gimp_palette(p)
except Exception as e:
@ -257,33 +290,41 @@ def load_lexers():
global context
# load available pygments lexers
lexers = []
global get_lexer_by_name
from pygments.lexers import get_lexer_by_name
global highlight
from pygments import highlight
global Terminal256Formatter
from pygments.formatters import Terminal256Formatter
global TerminalFormatter
from pygments.formatters import TerminalFormatter
from pygments.lexers import get_all_lexers
try:
global get_lexer_by_name
from pygments.lexers import get_lexer_by_name
global highlight
from pygments import highlight
global Terminal256Formatter
from pygments.formatters import Terminal256Formatter
global TerminalFormatter
from pygments.formatters import TerminalFormatter
from pygments.lexers import get_all_lexers
except ImportError:
logging.warning("the pygments module has not been found, syntax coloring is not available")
pass
else:
for lexer in get_all_lexers():
try:
lexers.append(lexer[1][0])
except IndexError:
logging.warning("cannot load lexer: %s" % lexer[1][0])
pass
l = None
# If the tuple has one-word aliases
# (which are usually a better option than the long names
# for a command line argument).
if lexer[1]:
l = lexer[1][0] # Take the first one.
else:
logging.debug("loaded lexer %s" % lexer[1][0])
lexers.sort()
assert(lexer[0])
l = lexer[0] # Take the long name, which should alway exists.
if not l:
logging.warning("cannot load lexer: %s" % lexer[1][0])
pass # Forget about this lexer.
else:
assert(" " not in l) # Should be very rare, but probably a source of bugs.
lexers.append(l)
except:
logging.warning("error while executing the pygment module, syntax coloring is not available")
lexers.sort()
logging.debug("loaded %i lexers: %s" % (len(lexers), ", ".join(lexers)))
context["lexers"] = lexers
@ -325,17 +366,17 @@ def mode( color ):
raise UnknownColor(color)
def next_in_map( color ):
def next_in_map( name ):
global context
# loop over indices in colormap
return (context["colormap_idx"]+1) % len(context["colormaps"][color])
return (context["colormap_idx"]+1) % len(context["colormaps"][name])
def color_random( color ):
global context
m = mode(color)
if m == 8:
color_name = random.choice(context["colormaps"]["random"])
color_name = random.choice(list(context["colormaps"]["random"]))
color_code = context["colors"][color_name]
color_code = str(30 + color_code)
@ -374,23 +415,11 @@ def color_scale( name, text ):
nb = "".join([i for i in filter(allowed.__contains__, text)])
# interpret as decimal
# First, try with the babel module, if available
# if not, use python itself,
# if thoses fails, try to `eval` the string
# (this allow strings like "1/2+0.9*2")
f = None
try:
# babel is a specialized module
import babel.numbers as bn
try:
f = float(bn.parse_decimal(nb))
except bn.NumberFormatError:
pass
except ImportError:
try:
f = float(nb)
except ValueError:
pass
f = float(bn.parse_decimal(nb))
except bn.NumberFormatError:
pass
if f is not None:
# normalize with scale if it's a number
f = (f - context["scale"][0]) / (context["scale"][1]-context["scale"][0])
@ -444,7 +473,7 @@ def color_hash( name, text ):
def color_map(name):
global context
# current color
color = context["colormaps"][name][context["colormap_idx"]]
color = context["colormaps"][name][ context["colormap_idx"] ]
m = mode(color)
if m == 8:
@ -454,9 +483,9 @@ def color_map(name):
assert( 0 <= color_nb <= 255 )
color_code = str(color_nb)
context["colormap_idx"] = next_in_map(color)
context["colormap_idx"] = next_in_map(name)
return color_code
return color,color_code
def color_lexer( name, style, text ):
@ -480,10 +509,14 @@ def color_lexer( name, style, text ):
return "<"+name+">"+ highlight(text, lexer, formatter)[:-1] + "</"+name+">"
def colorin(text, color="red", style="normal"):
def colorin(text, color="red", style="normal", sep_pair=context["sep_pair"]):
"""
Return the given text, surrounded by the given color ASCII markers.
The given color may be either a single name, encoding the foreground color,
or a pair of names, delimited by the given sep_pair,
encoding foreground and background, e.g. "red.blue".
If the given color is a name that exists in available colors,
a 8-colors mode is assumed, else, a 256-colors mode.
@ -508,18 +541,24 @@ def colorin(text, color="red", style="normal"):
color_code = ""
style_code = ""
background_code = ""
style_codes = []
# Convert the style code
if style == "random" or style == "Random":
style = random.choice(list(context["styles"].keys()))
else:
if style in context["styles"]:
style_code = str(context["styles"][style])
styles = style.split(sep_pair)
for astyle in styles:
if astyle in context["styles"]:
style_codes.append(str(context["styles"][astyle]))
style_code = ";".join(style_codes)
color = color.strip()
m = mode(color)
color_pair = color.strip().split(sep_pair)
color = color_pair[0]
background = color_pair[1] if len(color_pair) == 2 else "none"
if color == "none":
if color == "none" and background == "none":
# if no color, style cannot be applied
if not debug:
return text
@ -536,10 +575,10 @@ def colorin(text, color="red", style="normal"):
elif color.lower() == "hash":
color_code = color_hash( color, text )
# Really useful only when using colout as a library
# thus you can change the "colormap" variable to your favorite one before calling colorin
# The user can change the "colormap" variable to its favorite one before calling colorin.
elif color == "colormap":
color_code = color_map(color)
# "default" should have been set to the user-defined colormap.
color,color_code = color_map("default")
# Registered colormaps should be tested after special colors,
# because special tags are also registered as colormaps,
@ -572,14 +611,28 @@ def colorin(text, color="red", style="normal"):
else:
raise UnknownColor(color)
m = mode(color)
if background in context["backgrounds"] and m == 8:
background_code = endmarks[m] + str(40 + context["backgrounds"][background])
elif background == "none":
background_code = ""
else:
raise UnknownColor(background)
if color_code is not None:
if not debug:
return start + style_code + endmarks[m] + color_code + "m" + text + stop
return start + style_code + endmarks[m] + color_code + background_code + "m" + text + stop
else:
return start + style_code + endmarks[m] + color_code + "m" \
+ "<color name=" + str(color) + " code=" + color_code \
+ " style=" + str(style) + " stylecode=" + style_code \
+ " mode=" + str(m) + ">" \
return start + style_code + endmarks[m] + color_code + background_code + "m" \
+ "<color name=" + str(color) \
+ " code=" + color_code \
+ " style=" + str(style) \
+ " stylecode=" + style_code \
+ " background=" + str(background) \
+ " backgroundcode=" + background_code.strip(endmarks[m]) \
+ " mode=" + str(m) \
+ ">" \
+ text + "</color>" + stop
else:
if not debug:
@ -601,7 +654,7 @@ def colorout(text, match, prev_end, color="red", style="normal", group=0):
return colored_text, end
def colorup(text, pattern, color="red", style="normal", on_groups=False):
def colorup(text, pattern, color="red", style="normal", on_groups=False, sep_list=context["sep_list"]):
"""
Color up every characters that match the given regexp patterns.
If groups are specified, only color up them and not the whole pattern.
@ -610,20 +663,8 @@ def colorup(text, pattern, color="red", style="normal", on_groups=False):
in which case the different matching groups may be formatted differently.
If there is less colors/styles than groups, the last format is used
for the additional groups.
>>> colorup("Fetchez la vache", "vache", "red", "bold")
'Fetchez la \x1b[1;31mvache\x1b[0m'
>>> colorup("Faites chier la vache", "[Fv]a", "red", "bold")
'\x1b[1;31mFa\x1b[0mites chier la \x1b[1;31mva\x1b[0mche'
>>> colorup("Faites Chier la Vache", "[A-Z](\S+)\s", "red", "bold")
'F\x1b[1;31maites\x1b[0m C\x1b[1;31mhier\x1b[0m la Vache'
>>> colorup("Faites Chier la Vache", "([A-Z])(\S+)\s", "red,green", "bold")
'\x1b[1;31mF\x1b[0m\x1b[1;32maites\x1b[0m \x1b[1;31mC\x1b[0m\x1b[1;32mhier\x1b[0m la Vache'
>>> colorup("Faites Chier la Vache", "([A-Z])(\S+)\s", "green")
'\x1b[0;32mF\x1b[0m\x1b[0;32maites\x1b[0m \x1b[0;32mC\x1b[0m\x1b[0;32mhier\x1b[0m la Vache'
>>> colorup("Faites Chier la Vache", "([A-Z])(\S+)\s", "blue", "bold,italic")
'\x1b[1;34mF\x1b[0m\x1b[3;34maites\x1b[0m \x1b[1;34mC\x1b[0m\x1b[3;34mhier\x1b[0m la Vache'
"""
global context
global debug
@ -649,11 +690,11 @@ def colorup(text, pattern, color="red", style="normal", on_groups=False):
# Build a list of colors that match the number of grouped,
# if there is not enough colors, duplicate the last one.
colors_l = color.split(",")
colors_l = color.split(sep_list)
group_colors = colors_l + [colors_l[-1]] * (nb_groups - len(colors_l))
# Same for styles
styles_l = style.split(",")
styles_l = style.split(sep_list)
group_styles = styles_l + [styles_l[-1]] * (nb_groups - len(styles_l))
# If we want to iterate colormaps on groups instead of patterns
@ -733,7 +774,7 @@ def map_write( stream_in, stream_out, function, *args ):
write( function(item, *args), stream_out )
def colorgen(stream, pattern, color="red", style="normal", on_groups=False):
def colorgen(stream, pattern, color="red", style="normal", on_groups=False, sep_list=context["sep_list"]):
"""
A generator that colors the items given in an iterable input.
@ -749,7 +790,7 @@ def colorgen(stream, pattern, color="red", style="normal", on_groups=False):
break
if not item:
break
yield colorup(item, pattern, color, style, on_groups)
yield colorup(item, pattern, color, style, on_groups, sep_list)
######################
@ -768,11 +809,6 @@ def _args_parse(argv, usage=""):
help="A regular expression")
pygments_warn=" You can use a language name to activate syntax coloring (see `-r all` for a list)."
try:
import pygments
except ImportError:
pygments_warn=" (WARNING: python3-pygments is not available, \
install it if you want to be able to use syntax coloring)"
parser.add_argument("color", metavar="COLOR", type=str, nargs='?',
default="red",
@ -792,12 +828,6 @@ def _args_parse(argv, usage=""):
(cycle the colors at each match)")
babel_warn=" (numbers will be parsed according to your locale)"
try:
# babel is a specialized module
import babel.numbers
except ImportError:
babel_warn=" (WARNING: python3-babel is not available, install it \
if you want to be able to parse numbers according to your locale)"
parser.add_argument("-l", "--scale", metavar="SCALE",
help="When using the 'scale' colormap, parse matches as decimal numbers \
@ -820,7 +850,8 @@ def _args_parse(argv, usage=""):
parser.add_argument("-d", "--default", metavar="COLORMAP", default=None,
help="When using special colormaps (`random`, `scale` or `hash`), use this COLORMAP. \
This can be either one of the available colormaps or a comma-separated list of colors. \
WARNING: be sure to specify a default colormap that is compatible with the special colormap's mode.")
WARNING: be sure to specify a default colormap that is compatible with the special colormap's mode \
(8 or 256 colors).")
# This normally should be an option with an argument, but this would end in an error,
# as no regexp is supposed to be passed after calling this option,
@ -837,14 +868,24 @@ def _args_parse(argv, usage=""):
if it is lower case, use the 8 colors mode. \
Interpret COLOR as a Pygments style." + pygments_warn)
parser.add_argument("-e", "--sep-list", metavar="CHAR", default=",", type=str,
help="Use this character as a separator for list of colors/resources/numbers (instead of comma).")
parser.add_argument("-E", "--sep-pair", metavar="CHAR", default=".", type=str,
help="Use this character as a separator for foreground/background pairs (instead of period).")
parser.add_argument("--debug", action="store_true",
help="Debug mode: print what's going on internally, useful if you want to check what features are available.")
# HACK: Mock up "--resources ALL" if just "--resources" on command line
if (len(sys.argv) == 2 and (sys.argv[1] in ["-r", "--resources"])):
sys.argv.append("ALL")
args = parser.parse_args()
return args.pattern[0], args.color, args.style, args.groups, \
args.colormap, args.theme, args.source, args.all, args.scale, args.debug, args.resources, args.palettes_dir, \
args.themes_dir, args.default
args.themes_dir, args.default, args.sep_list, args.sep_pair
def write_all( as_all, stream_in, stream_out, function, *args ):
@ -858,17 +899,15 @@ def write_all( as_all, stream_in, stream_out, function, *args ):
map_write( stream_in, stream_out, function, *args )
if __name__ == "__main__":
error_codes = {"UnknownColor":1, "DuplicatedPalette":2}
def main():
global context
usage = "A regular expression based formatter that color up an arbitrary text stream."
#####################
# Arguments parsing #
#####################
pattern, color, style, on_groups, as_colormap, as_theme, as_source, as_all, myscale, \
debug, resources, palettes_dirs, themes_dirs, default_colormap \
debug, resources, palettes_dirs, themes_dirs, default_colormap, sep_list, sep_pair \
= _args_parse(sys.argv, usage)
if debug:
@ -882,6 +921,12 @@ if __name__ == "__main__":
##################
# Load resources #
##################
context["sep_list"] = sep_list
logging.debug("Color list separator: '%s'" % context["sep_list"])
context["sep_pair"] = sep_pair
logging.debug("Color pair separator: '%s'" % context["sep_pair"])
try:
# Search for available resources files (themes, palettes)
# in the same dir as the colout.py script
@ -893,30 +938,28 @@ if __name__ == "__main__":
# try additional directories if asked
if palettes_dirs:
for adir in palettes_dirs:
try:
os.chdir( adir )
except OSError as e:
logging.warning("cannot read palettes directory %s, ignore it" % adir)
continue
else:
if os.path.isdir(adir):
load_palettes( adir )
else:
logging.warning("cannot read palettes directory %s, ignore it" % adir)
if themes_dirs:
for adir in themes_dirs:
try:
os.chdir( adir )
except OSError as e:
logging.warning("cannot read themes directory %s, ignore it" % adir)
continue
else:
if os.path.isdir(adir):
load_themes( adir )
else:
logging.warning("cannot read themes directory %s, ignore it" % adir)
except DuplicatedPalette as e:
logging.error( "duplicated palette file name: %s" % e )
sys.exit( error_codes["DuplicatedPalette"] )
# if debug:
# setting = pprint.pformat(context, depth=2)
# logging.debug(setting)
if resources:
asked=[r.lower() for r in pattern.split(",")]
asked=[r.lower() for r in pattern.split(context["sep_list"])]
def join_sort( l ):
"""
@ -930,33 +973,49 @@ if __name__ == "__main__":
return ", ".join(sorted(l, key=lambda s: s.lower()+s))
# print("Available resources:")
resources_not_found = []
for res in asked:
resource_found = False
if "style" in res or "all" in res:
print("STYLES: %s" % join_sort(context["styles"]) )
resource_found = True
if "color" in res or "all" in res:
print("COLORS: %s" % join_sort(context["colors"]) )
resource_found = True
if "special" in res or "all" in res:
print("SPECIAL: %s" % join_sort(["random", "Random", "scale", "Scale", "hash", "Hash", "colormap"]) )
resource_found = True
if "theme" in res or "all" in res:
if len(context["themes"]) > 0:
print("THEMES: %s" % join_sort(context["themes"].keys()) )
else:
print("NO THEME")
resource_found = True
if "colormap" in res or "all" in res:
if len(context["colormaps"]) > 0:
print("COLORMAPS: %s" % join_sort(context["colormaps"]) )
else:
print("NO COLORMAPS")
resource_found = True
if "lexer" in res or "all" in res:
if len(context["lexers"]) > 0:
print("SYNTAX COLORING: %s" % join_sort(context["lexers"]) )
else:
print("NO SYNTAX COLORING (check that python3-pygments is installed)")
resource_found = True
if not resource_found:
resources_not_found.append(res)
if resources_not_found:
logging.error( "Unknown resources: %s" % ", ".join(resources_not_found) )
sys.exit( error_codes["UnknownResource"] )
sys.exit(0) # not an error, we asked for help
@ -966,25 +1025,25 @@ if __name__ == "__main__":
try:
if myscale:
context["scale"] = tuple([float(i) for i in myscale.split(",")])
context["scale"] = tuple([float(i) for i in myscale.split(context["sep_list"])])
logging.debug("user-defined scale: %f,%f" % context["scale"])
# Default color maps
if default_colormap:
if default_colormap not in context["colormaps"]:
cmap = default_colormap.split(",")
cmap = make_colormap(default_colormap,context["sep_list"])
elif default_colormap in context["colormaps"]:
cmap = context["colormaps"][default_colormap]
set_special_colormaps( cmap )
set_special_colormaps( cmap, context["sep_list"] )
# explicit color map
if as_colormap is True and color not in context["colormaps"]:
context["colormaps"]["Default"] = color.split(",") # replace the colormap by the given colors
context["colormaps"]["default"] = color.split(",") # replace the colormap by the given colors
context["colormaps"]["Default"] = make_colormap(color,context["sep_list"]) # replace the colormap by the given colors
context["colormaps"]["default"] = make_colormap(color,context["sep_list"]) # replace the colormap by the given colors
color = "colormap" # use the keyword to switch to colormap instead of list of colors
logging.debug("used-defined default colormap: %s" % ",".join(context["colormaps"]["Default"]) )
logging.debug("used-defined default colormap: %s" % context["sep_list"].join(context["colormaps"]["Default"]) )
# if theme
if as_theme:
@ -996,7 +1055,9 @@ if __name__ == "__main__":
# if pygments
elif as_source:
logging.debug("asked for lexer: %s" % pattern.lower())
assert(pattern.lower() in context["lexers"])
if pattern.lower() not in context["lexers"]:
logging.error("Lexer %r is not available. Run with \"--resources all\" to see the options.")
sys.exit(error_codes["UnknownLexer"])
lexer = get_lexer_by_name(pattern.lower())
# Python => 256 colors, python => 8 colors
ask_256 = pattern[0].isupper()
@ -1015,14 +1076,20 @@ if __name__ == "__main__":
# if color
else:
write_all( as_all, sys.stdin, sys.stdout, colorup, pattern, color, style, on_groups )
write_all( as_all, sys.stdin, sys.stdout, colorup, pattern, color, style, on_groups, context["sep_list"] )
except UnknownColor as e:
if debug:
import traceback
for var in context:
print(var,context[var])
print(traceback.format_exc())
logging.error("unknown color: %s (maybe you forgot to install python3-pygments?)" % e )
logging.error("Unknown color: %s (maybe you forgot to install python3-pygments?)" % e )
sys.exit( error_codes["UnknownColor"] )
except MixedModes as e:
logging.error("You cannot mix up color modes when defining your own colormap." \
+ " Check the following 'color:mode' pairs: %s." % e )
sys.exit( error_codes["MixedModes"] )
if __name__ == "__main__":
main()

23
colout/colout_catch2.py Normal file
View file

@ -0,0 +1,23 @@
def theme(context):
return context,[
["^ (Start)(.*): (.*):(.*)$", "yellow", "normal,normal,normal,bold"], # Test start.
# path file ext:line :
["^(tests): (/.*?)/([^/:]+):([0-9]+): (.*)", "yellow,none,white,yellow,red", "bold,normal,bold,normal,bold"],
["(`)(.*)('.*)", "red,Cpp,red", "bold,normal,bold"],
[r"^\.+$", "yellow", "bold"],
["^=+$", "yellow", "bold"],
["(/.*?)/([^/:]+):([0-9]+): (FAILED):", "white,white,yellow,red", "normal,bold,normal,bold"],
[r"(REQUIRE\(|CHECK\(|REQUIRE_THAT\()(.*)(\))$","yellow,Cpp,yellow","bold,normal,bold"],
# Hide uninteresting stuff:
["[0-9]+/[0-9]+ Test.*","blue"],
["^Filters:.*","blue"],
["^Randomness seeded to:.*","blue"],
["^tests is a Catch2.*","blue"],
["^Run with.*", "blue"],
["^~+$","blue"],
["^-+$","blue"],
[r"^\s*(Scenario:|Given:|When:|Then:).*","blue"],
["^(/.*?)/([^/:]+):([0-9]+)", "blue"],
["^(test cases|assertions)(.*)", "blue"],
]

View file

@ -1 +0,0 @@
colout_g++.py

85
colout/colout_clang.py Normal file
View file

@ -0,0 +1,85 @@
#encoding: utf-8
def default_gettext( msg ):
return msg
def theme(context):
import os
import gettext
import locale
section="blue"
# get g++ version
gv = os.popen("g++ -dumpversion").read().strip()
# get the current translations of gcc
try:
t = gettext.translation("gcc-"+gv)
except IOError:
_ = default_gettext
else:
_ = t.gettext
# _("msg") will return the given message, translated
# if the locale is unicode
enc = locale.getpreferredencoding()
if "UTF" in enc:
# gcc will use unicode quotes
qo = "[`]"
qc = "[']"
else:
# rather than ascii ones
qo = "['`]"
qc = "'"
return context,[
# Command line
[ r"[/\s]([cg]\+\+-*[0-9]*\.*[0-9]*)", "white", "bold" ],
[ r"\s(\-D)(\s*[^\s]+)", "none,green", "normal,bold" ],
[ r"\s(-g)", "green", "normal" ],
[ r"\s-O[0-4]", "green", "normal" ],
[ r"\s-[Wf][^\s]*", "magenta", "normal" ],
[ r"\s-pedantic", "magenta", "normal" ],
[ r"\s(-I)(/*[^\s]+/)([^/\s]+)", "none,blue", "normal,normal,bold" ],
[ r"\s(-L)(/*[^\s]+/)([^/\s]+)", "none,cyan", "normal,normal,bold" ],
[ r"\s(-l)([^/\s]+)", "none,cyan", "normal,bold" ],
[ r"\s-[oc]", "red", "bold" ],
[ r"\s(-+std(?:lib)?)=?([^\s]+)", "red", "normal,bold" ],
# Important messages
[ _("error: "), "red", "bold" ],
[ _("fatal error: "), "red", "bold" ],
[ _("warning: "), "magenta", "bold" ],
[ _("undefined reference to "), "red", "bold" ],
# [-Wflag]
[ r"\[-W.*\]", "magenta"],
# Highlight message start:
# path file ext : line : col …
[ "(/.*?)/([^/:]+): (In .*)"+qo,
section,
"normal,normal,bold" ],
[ "(/.*?)/([^/:]+): (At .*)",
section,
"normal,normal,bold" ],
[ _("In file included from"), section ],
# Highlight locations:
# path file ext : line : col …
[ "(/.*?)/([^/:]+):([0-9]+):*([0-9]*)(.*)",
"none,white,yellow,none,none",
"normal,normal,normal,normal" ],
# source code in single quotes
[ qo+"(.*?)"+qc, "Cpp", "monokai" ],
# source code after a "note: candidate are/is:"
[ _("note: ")+"((?!.*("+qo+"|"+qc+")).*)$", "Cpp", "monokai" ],
# [ _("note: ")+"(candidate:)(.*)$", "green,Cpp", "normal,monokai" ],
# after the code part, to avoid matching ANSI escape chars
[ _("note: "), "green", "normal" ]
]

View file

@ -25,29 +25,31 @@ def theme(context):
[ "^-- Configuring incomplete, errors occurred!", "red" ],
[ "^--.*", performing ],
# Errors
[ "CMake Error:", "red" ],
[ "CMake Warning", "yellow" ],
[ "CMake Error", "red" ],
[ "CMake Warning", "magenta" ],
[ "CMake Deprecation Warning", "magenta" ],
# Scan
[ "^(Scanning dependencies of target)(.*)$",
performing, "normal,bold" ],
# Link (make)
[ "^(Linking .* )(library|executable) (.*/)*(.+(\.[aso]+)*)$",
# [ "^(Linking .* )(library|executable) (.*/)*(.+(\.[aso]+)*)$",
[ "^(Linking .* )(library|executable) (.*)$",
untimed, "normal,normal,bold" ],
# [percent] Creating something
[ "^\[\s*[0-9/]+%?\]\s(.*Creating.*)$",
[ r"^\[\s*[0-9/]+%?\]\s(.*Creating.*)$",
performing, "normal" ],
# [percent] Built
[ "^\[\s*[0-9/]+%?\]\s(Built target)(\s.*)$",
[ r"^\[\s*[0-9/]+%?\]\s(Built target)(\s.*)$",
performed, "normal,bold" ],
# [percent] Building
[ "^\[\s*[0-9/]+%?\]\s(Building \w* object)\s+(.*)(\.dir)(.*/)([-\w]+).c.*.o$",
[ r"^\[\s*[0-9/]+%?\]\s(Building \w* object)\s+(.*)(\.dir)(.*/)([-\w]+).c.*.o$",
performing+","+performing+","+performing+",Hash,"+performing, "normal,normal,normal,normal,bold"],
# [percent] Generating
[ "^\[\s*[0-9/]+%?\]\s(Generating)(\s+.*)$",
[ r"^\[\s*[0-9/]+%?\]\s(Generating)(\s+.*)$",
performing, "normal,bold"],
# make errors
[ "make\[[0-9]+\].*", "yellow"],
[ "(make: \*\*\* \[.+\] )(.* [0-9]+)", "red", "normal,bold"],
[ r"make\[[0-9]+\].*", "yellow"],
[ r"(make: \*\*\* \[.+\] )(.* [0-9]+)", "red", "normal,bold"],
# progress percentage (make)
[ "^(\[\s*[0-9]+%\])","Scale" ]
[ r"^(\[\s*[0-9]+%\])","Scale" ]
]

View file

@ -8,6 +8,9 @@ def theme(context):
["^(configure:) (error:)(.*)", "red","normal,bold"],
["^(configure:)(.*)", "magenta","normal,bold"],
["^(checking .*)", "blue",""],
["^(config.status:) (creating )(.*)", "cyan,blue","normal,normal,bold"],
["^(config.status:) (creating|linking)(.*)", "cyan,blue","normal,normal,bold"],
["^(config.status:) (executing )(.*)", "cyan,green","normal,normal,bold"],
["^(config.status:) (.*)(is unchanged)", "cyan,green","normal,normal,bold"],
[r"^\s*(Build.*)(yes)$","green", "normal,bold"],
[r"^\s*(Build.*)(no)$","yellow", "normal,bold"],
]

View file

@ -2,6 +2,7 @@
def theme(context):
# CTest theme:
passed="green"
notrun="yellow"
notpassed="red"
# If the user do not ask for his own colormap
@ -12,6 +13,7 @@ def theme(context):
return context,[
# Passed
[ "^\s*[0-9]+/[0-9]+ Test\s+#[0-9]+: (.*)\s+\.+\s+(Passed)", passed],
[ "^\s*[0-9]+/[0-9]+ Test\s+#[0-9]+: (.*)\s+\.+(\*{3}.*)\s+.*", notpassed]
[ r"^\s*[0-9]+/[0-9]+ Test\s+#[0-9]+: (.*)\s+\.+\s+(Passed)", "blue,"+passed],
[ r"^\s*[0-9]+/[0-9]+ Test\s+#[0-9]+: (.*)\s+\.+(\*{3}Not Run.*)\s+.*", "blue,"+notrun],
[ r"^\s*[0-9]+/[0-9]+ Test\s+#[0-9]+: (.*)\s+\.+(.*\*{3}.*)\s+.*", "blue,"+notpassed],
]

36
colout/colout_django.py Normal file
View file

@ -0,0 +1,36 @@
def theme(context):
return context,[
# Waiting
["^Waiting for .*$", "red", "bold"],
[".*Sending.*", "green"],
# Watches
[r"^(Watching) (\S*) (.*)", "yellow", "bold,bold,normal"],
[".*reloading.$","yellow"],
# File from python/lib
[r"^(File) (/.*/lib/python[^/]*/site-packages/)([^/]*)\S* (first seen) (with mtime [0-9]*.*)$",
"blue,blue,white,blue,blue", "bold,normal,bold,bold,normal"],
# File from app (last 3 name highlighted)
[r"^(File) (/\S*/)(\S*/\S*/)(\S*) (first seen) (with mtime [0-9]*.*)$",
"magenta,magenta,white,white,magenta,magenta", "bold,normal,normal,bold,bold,normal"],
# SQL
["(.*)(SELECT)(.*)(FROM)(.*)",
"green", "normal,bold,normal,bold,normal"],
["(.*)(SELECT)(.*)(FROM)(.*)(WHERE)(.*)",
"green", "normal,bold,normal,bold,normal,bold,normal"],
# HTTP
[r"\"(GET) (\S*) (HTTP\S*)\" ([0-9]+) (.*)$",
"green,white,green,green,green", "bold,bold,normal,bold,normal"],
# Errors
["(Exception) (while .*) '(.*)' (in) (.*) '(.*)'", "red,red,white,red,red,white", "bold,normal,bold,bold,normal,bold"],
["(.*Error): (.*) '(.*)'", "red,red,white", "bold,normal,bold"],
[r"(django[^:\s]*)\.([^.:\s]*): (.*)", "red","normal,bold,normal"],
["Traceback.*:","yellow"],
["During handling.*","yellow"],
# File, line, in
[
r"^\s{2}(File \")(/*.*?/)*([^/:]+)(\", line) ([0-9]+)(, in) (.*)$",
"blue, none, white,blue, yellow,blue",
"normal,normal,bold, normal,normal,bold"
],
]

View file

@ -35,16 +35,17 @@ def theme(context):
return context,[
# Command line
[ "[/\s]([cg]\+\+-*[0-9]*\.*[0-9]*)", "white", "bold" ],
[ "\s(\-D)(\s*[^\s]+\s)", "none,green", "normal,bold" ],
[ "\s-g\s", "green", "normal" ],
[ "\s-O[0-4]*\s", "green", "normal" ],
[ "\s-[Wf][^\s]*", "magenta", "normal" ],
[ "\s(-I)(/*[^\s]+/)([^/\s]+)", "none,blue", "normal,normal,bold" ],
[ "\s(-L)(/*[^\s]+/)([^/\s]+)", "none,cyan", "normal,normal,bold" ],
[ "\s(-l)([^/\s]+)", "none,cyan", "normal,bold" ],
[ "\s-[oc]", "red", "bold" ],
[ "\s(-+std)=*([^s]+)", "red", "normal,bold" ],
[ r"[/\s]([cg]\+\+-*[0-9]*\.*[0-9]*)", "white", "bold" ],
[ r"\s(\-D)(\s*[^\s]+)", "none,green", "normal,bold" ],
[ r"\s(-g)", "green", "normal" ],
[ r"\s-O[0-4]", "green", "normal" ],
[ r"\s-[Wf][^\s]*", "magenta", "normal" ],
[ r"\s-pedantic", "magenta", "normal" ],
[ r"\s(-I)(/*[^\s]+/)([^/\s]+)", "none,blue", "normal,normal,bold" ],
[ r"\s(-L)(/*[^\s]+/)([^/\s]+)", "none,cyan", "normal,normal,bold" ],
[ r"\s(-l)([^/\s]+)", "none,cyan", "normal,bold" ],
[ r"\s-[oc]", "red", "bold" ],
[ r"\s(-+std(?:lib)?)=?([^\s]+)", "red", "normal,bold" ],
# Important messages
[ _("error: "), "red", "bold" ],
@ -52,7 +53,7 @@ def theme(context):
[ _("warning: "), "magenta", "bold" ],
[ _("undefined reference to "), "red", "bold" ],
# [-Wflag]
[ "\[-W.*\]", "magenta"],
[ r"\[-W.*\]", "magenta"],
# Highlight message start:
# path file ext : line : col …

View file

@ -3,13 +3,13 @@
def theme(context):
style="monokai"
return context,[
[ "^(.*\.java):([0-9]+):\s*(warning:.*)$", "white,yellow,magenta", "normal,normal,bold" ],
[ "^(.*\.java):([0-9]+):(.*)$", "white,yellow,red", "normal,normal,bold" ],
[ "^(symbol|location)\s*:\s*(.*)$", "blue,Java", "bold,"+style ],
[ "^(found)\s*:\s*(.*)", "red,Java", "bold,"+style ],
[ "^(required)\s*:\s*(.*)", "green,Java", "bold,"+style ],
[ "^\s*\^$", "cyan", "bold" ],
[ "^\s+.*$", "Java", style ],
[ r"^(.*\.java):([0-9]+):\s*(warning:.*)$", "white,yellow,magenta", "normal,normal,bold" ],
[ r"^(.*\.java):([0-9]+):(.*)$", "white,yellow,red", "normal,normal,bold" ],
[ r"^(symbol|location)\s*:\s*(.*)$", "blue,Java", "bold,"+style ],
[ r"^(found)\s*:\s*(.*)", "red,Java", "bold,"+style ],
[ r"^(required)\s*:\s*(.*)", "green,Java", "bold,"+style ],
[ r"^\s*\^$", "cyan", "bold" ],
[ r"^\s+.*$", "Java", style ],
[ "[0-9]+ error[s]*", "red", "bold" ],
[ "[0-9]+ warning[s]*", "magenta", "bold" ],
]

View file

@ -3,10 +3,10 @@ def theme(context):
# This theme expect a formatted JSON input, with items spread across lines.
# See tools like "python -m json.tool" or "json_xs"
return context,[
[ '[\[\]{}],*\s*\n' ],
[ r'[\[\]{}],*\s*\n' ],
[ '" (:) ', "yellow" ],
[ '[\]}"](,)', "yellow" ],
[ "\"(-*[0-9]+\.*[0-9]*e*-*[0-9]*)\"", "blue" ],
[ r'[\]}"](,)', "yellow" ],
[ r"\"(-*[0-9]+\.*[0-9]*e*-*[0-9]*)\"", "blue" ],
[ '"(.*)"', "green" ],
[ """["']""", "cyan" ]
]

View file

@ -7,19 +7,20 @@ def theme(context):
"magenta,magenta,white,magenta", "normal,bold,normal" ],
["(LaTeX Warning): (.*)", "magenta", "normal,bold" ],
["(LaTeX Error): (.*)", "red", "normal,bold" ],
["^(.*\.tex):([0-9]+): (.*)", "white,yellow,red", "normal,normal,bold" ],
[r"^(.*\.tex):([0-9]+): (.*)", "white,yellow,red", "normal,normal,bold" ],
# ["on (page [0-9]+)", "yellow", "normal" ],
["on input (line [0-9]+)", "yellow", "normal" ],
["^! .*$", "red", "bold"],
["(.*erfull) ([^\s]+).* in [^\s]+ at (lines [0-9]+--[0-9]+)",
[r"(.*erfull) ([^\s]+).* in [^\s]+ at (lines [0-9]+--[0-9]+)",
"magenta,magenta,yellow", "normal"],
["\\[^\s]+\s", "white", "bold"],
["^l\.([0-9]+) (.*)", "yellow,tex"],
["^\s+(.*)", "tex"],
["(Output written on) (.*) \(([0-9]+ pages), [0-9]+ bytes\).",
[r"\\[^\s]+\s", "white", "bold"],
[r"^l\.([0-9]+) (.*)", "yellow,tex"],
[r"^\s+(.*)", "tex"],
[r"(Output written on) (.*) \(([0-9]+ pages), [0-9]+ bytes\).",
"blue,white,blue", "normal,bold,normal"],
["WARNING.*", "magenta", "normal"],
["warning.*", "magenta", "normal"],
["[wW]arning.*", "magenta", "normal"],
["No pages of output", "red", "bold"],
# BiBTeX
["^(I couldn't) (.*)", "red", "normal,bold"],

View file

@ -11,9 +11,9 @@ def theme(context):
context["scale"] = (0,1)
# Link (ninja)
th.append( [ "^\[[0-9/]+\]\s?(Linking .* )(library|executable) (.*/)*(.+(\.[aso]+)*)$",
th.append( [ r"^\[[0-9/]+\]\s?(Linking .* )(library|executable) (.*/)*(.+(\.[aso]+)*)$",
"blue", "normal,normal,bold" ] )
# progress percentage (ninja)
th.append( [ "^(\[[0-9]+/[0-9]+\])","Scale" ] )
th.append( [ r"^(\[[0-9]+/[0-9]+\])","Scale" ] )
return context,th

View file

@ -1,7 +1,7 @@
def theme(context):
p="([rwxs-])"
reg="^([d-])"+p*9+"\s.*$"
p="([-rwxsStT])"
reg=r"^([-dpcCDlMmpPs?])"+p*9+r"\s.*$"
colors="blue"+",green"*3+",yellow"*3+",red"*3
styles="normal"+ ",normal,italic,bold"*3
return context,[ [reg, colors, styles] ]

View file

@ -5,16 +5,16 @@ def theme(context):
["^Traceback .*$", "blue" ],
# File, line, in
[
"^\s{2}(File \")(/*.*?/)*([^/:]+)(\", line) ([0-9]+)(, in) (.*)$",
r"^\s{2}(File \")(/*.*?/)*([^/:]+)(\", line) ([0-9]+)(, in) (.*)$",
"blue, none, white,blue, yellow,blue",
"normal,normal,bold, normal,normal,bold"
],
# ["^\s{2}File \"(.*)\", line ([0-9]+), in (.*)$", "white,yellow,white", "normal,normal,bold" ],
# [r"^\s{2}File \"(.*)\", line ([0-9]+), in (.*)$", "white,yellow,white", "normal,normal,bold" ],
# Error name
["^([A-Za-z]*Error):*", "red", "bold" ],
["^([A-Za-z]*Exception):*", "red", "bold" ],
# any quoted things
["Error.*['\"](.*)['\"]", "magenta" ],
[r"Error.*['\"](.*)['\"]", "magenta" ],
# python code
["^\s{4}.*$", "Python", "monokai" ],
[r"^\s{4}.*$", "Python", "monokai" ],
]

117
colout/colout_slurm.py Normal file
View file

@ -0,0 +1,117 @@
def theme(context):
# SLURM's states (from squeue manual).
col_width = 9
COMPLETED =r"\bCOMPLETED"
PENDING =r"\bPENDING"
RUNNING =r"\bRUNNING"
CONFIGURING =r"\bCONFIGURING"
COMPLETING =r"\bCOMPLETING"
FAILED =r"\bFAILED"
DEADLINE =r"\bDEADLINE"
OUT_OF_MEMORY=r"\bOUT_OF_MEMORY"
TIMEOUT =r"\bTIMEOUT"
CANCELLED =r"\bCANCELLED"
BOOT_FAIL =r"\bBOOT_FAIL"
NODE_FAIL =r"\bNODE_FAIL"
PREEMPTED =r"\bPREEMPTED"
RESV_DEL_HOLD=r"\bRESV_DEL_HOLD"
REQUEUE_FED =r"\bREQUEUE_FED"
REQUEUE_HOLD =r"\bREQUEUE_HOLD"
REQUEUED =r"\bREQUEUED"
RESIZING =r"\bRESIZING"
REVOKED =r"\bREVOKED"
SIGNALING =r"\bSIGNALING"
SPECIAL_EXIT =r"\bSPECIAL_EXIT"
STAGE_OUT =r"\bSTAGE_OUT"
STOPPED =r"\bSTOPPED"
SUSPENDED =r"\bSUSPENDED"
return context,[
## No problem: greens
#Job has terminated all processes on all nodes with an exit code of zero.
[r"\bCD\b", "22"],
[COMPLETED[0:col_width]+r"\w*\b", "22"],
#Job is awaiting resource allocation.
[r"\bPD\b", "28"],
[PENDING[0:col_width]+r"\w*\b", "28"],
#Job currently has an allocation.
[r"\bR\b", "34"],
[RUNNING[0:col_width]+r"\w*\b", "34"],
#Job has been allocated resources, but are waiting for them to become ready for use (e.g. booting).
[r"\bCF\b", "58"],
[CONFIGURING[0:col_width]+r"\w*\b", "58"],
#Job is in the process of completing. Some processes on some nodes may still be active.
[r"\bCG\b", "23"],
[COMPLETING[0:col_width]+r"\w*\b", "23"],
## Problem for the user: bold reds
#Job terminated with non-zero exit code or other failure condition.
[r"\bF\b", "196"],
[FAILED[0:col_width]+r"\w*\b", "196", "bold"],
#Job terminated on deadline.
[r"\bDL\b", "160"],
[DEADLINE[0:col_width]+r"\w*\b", "160", "bold"],
#Job experienced out of memory error.
[r"\bOO\b", "197"],
[OUT_OF_MEMORY[0:col_width]+r"\w*\b", "197", "bold"],
#Job terminated upon reaching its time limit.
[r"\bTO\b", "161"],
[TIMEOUT[0:col_width]+r"\w*\b", "161", "bold"],
## Problem for the sysadmin: oranges
#Job was explicitly cancelled by the user or system administrator. The job may or may not have been initiated.
[r"\bCA\b", "202"],
[CANCELLED[0:col_width]+r"\w*\b", "202", "bold"],
#Job terminated due to launch failure, typically due to a hardware failure (e.g. unable to boot the node or block and the job can not be requeued).
[r"\bBF\b", "166"],
[BOOT_FAIL[0:col_width]+r"\w*\b", "166"],
#Job terminated due to failure of one or more allocated nodes.
[r"\bNF\b", "208"],
[NODE_FAIL[0:col_width]+r"\w*\b", "208"],
## Non-blocking events: blues
#Job terminated due to preemption.
[r"\bPR\b", "105"],
[PREEMPTED[0:col_width]+r"\w*\b", "105", "bold"],
#Job is being held after requested reservation was deleted.
[r"\bRD\b", "25"],
[RESV_DEL_HOLD[0:col_width]+r"\w*\b", "25"],
#Job is being requeued by a federation.
[r"\bRF\b", "26"],
[REQUEUE_FED[0:col_width]+r"\w*\b", "26"],
#Held job is being requeued.
[r"\bRH\b", "27"],
[REQUEUE_HOLD[0:col_width]+r"\w*\b", "27"],
#Completing job is being requeued.
[r"\bRQ\b", "31"],
[REQUEUED[0:col_width]+r"\w*\b", "31"],
#Job is about to change size.
[r"\bRS\b", "32"],
[RESIZING[0:col_width]+r"\w*\b", "32"],
#Sibling was removed from cluster due to other cluster starting the job.
[r"\bRV\b", "33"],
[REVOKED[0:col_width]+r"\w*\b", "33"],
#Job is being signaled.
[r"\bSI\b", "37"],
[SIGNALING[0:col_width]+r"\w*\b", "37"],
#The job was requeued in a special state. This state can be set by users, typically in EpilogSlurmctld, if the job has terminated with a particular exit value.
[r"\bSE\b", "38"],
[SPECIAL_EXIT[0:col_width]+r"\w*\b", "38"],
#Job is staging out files.
[r"\bSO\b", "39"],
[STAGE_OUT[0:col_width]+r"\w*\b", "39"],
#Job has an allocation, but execution has been stopped with SIGSTOP signal. CPUS have been retained by this job.
[r"\bST\b", "44"],
[STOPPED[0:col_width]+r"\w*\b", "44"],
#Job has an allocation, but execution has been suspended and CPUs have been released for other jobs.
[r"\bS\b", "45"],
[SUSPENDED[0:col_width]+r"\w*\b", "45"],
]

View file

@ -4,30 +4,30 @@ def theme(context):
return context, [
# section title
["^(==[0-9]+==\s{1})(Memcheck|Copyright|Using)(.*)$","blue",""],
["^(==[0-9]+==\s{1})(Warning)(.*)$","magenta",""],
["^(==[0-9]+==\s{1}Command: )(\S*)(.*)$","green,white","normal,bold,normal"],
["^(==[0-9]+==\s{1})(HEAP SUMMARY:)(.*)$","green",""],
["^(==[0-9]+==\s{1})(All heap blocks were freed)(.*)$","green",""],
["^(==[0-9]+==\s{1})(.*[rR]erun.*)$","blue",""],
["^(==[0-9]+==\s{1})(Use --.*)$","blue",""],
["^(==[0-9]+==\s{1}\S+.*)$","red",""],
[r"^(==[0-9]+==\s{1})(Memcheck|Copyright|Using)(.*)$","blue",""],
[r"^(==[0-9]+==\s{1})(Warning)(.*)$","magenta",""],
[r"^(==[0-9]+==\s{1}Command: )(\S*)(.*)$","green,white","normal,bold,normal"],
[r"^(==[0-9]+==\s{1})(HEAP SUMMARY:)(.*)$","green",""],
[r"^(==[0-9]+==\s{1})(All heap blocks were freed)(.*)$","green",""],
[r"^(==[0-9]+==\s{1})(.*[rR]erun.*)$","blue",""],
[r"^(==[0-9]+==\s{1})(Use --.*)$","blue",""],
[r"^(==[0-9]+==\s{1}\S+.*)$","red",""],
# section explanation
["^==[0-9]+==\s{2}(\S+.*)$","orange",""],
[r"^==[0-9]+==\s{2}(\S+.*)$","orange",""],
# locations adresses
["^==[0-9]+==\s{4}([atby]{2}) (0x0): (\?{3})",
[r"^==[0-9]+==\s{4}([atby]{2}) (0x0): (\?{3})",
"blue,yellow,red", "normal,normal,bold"],
["^==[0-9]+==\s{4}([atby]{2}) (0x)([^:]*:) (\S+)",
[r"^==[0-9]+==\s{4}([atby]{2}) (0x)([^:]*:) (\S+)",
"blue,blue,blue,none", "normal"],
# locations: library
["\(in (.*)\)", "cyan", "normal"],
[r"\(in (.*)\)", "cyan", "normal"],
# locations: file
["\(([^\.]*\.[^:]+):([0-9]+)\)", "white,yellow", "bold,normal"],
[r"\(([^\.]*\.[^:]+):([0-9]+)\)", "white,yellow", "bold,normal"],
# leak summary
["^==[0-9]+==\s{4}(definitely lost): .* (in) .*","red","bold"],
["^==[0-9]+==\s{4}(indirectly lost): .* (in) .*","orange","bold"],
["^==[0-9]+==\s{6}(possibly lost): .* (in) .*","yellow","bold"],
["^==[0-9]+==\s{4}(still reachable): .* (in) .*","green","bold"],
["^==[0-9]+==\s{9}(suppressed): .* (in) .*","cyan","bold"],
[r"^==[0-9]+==\s{4}(definitely lost): .* (in) .*","red","bold"],
[r"^==[0-9]+==\s{4}(indirectly lost): .* (in) .*","orange","bold"],
[r"^==[0-9]+==\s{6}(possibly lost): .* (in) .*","yellow","bold"],
[r"^==[0-9]+==\s{4}(still reachable): .* (in) .*","green","bold"],
[r"^==[0-9]+==\s{9}(suppressed): .* (in) .*","cyan","bold"],
]

26
colout/colout_vivado.py Normal file
View file

@ -0,0 +1,26 @@
def theme(context):
# Theme for coloring AMD/Xilinx Vivado IDE synthesis and implementation output
return context,[
[ r"^\s*\*+.+$", "green" ],
[ "^#.+", "green" ],
[ "^.+ Checksum: .+$", "green" ],
[ r"^.+Time \(s\).+", "green" ],
[ r"^Time \(s\).+", "green" ],
[ r"Estimated Timing Summary \|.+\|.+\|", "cyan", "bold" ],
[ r"Intermediate Timing Summary \|.+\|.+\|", "cyan", "bold" ],
[ "^INFO:", "white", "bold" ],
[ "^WARNING:.+$", "yellow" ],
[ "^CRITICAL WARNING:.+$", "red" ],
[ "^ERROR:.+$", "red" ],
[ "^Phase [0-9]+.[0-9]+.[0-9]+.[0-9]+.+$", "magenta", "bold" ],
[ "^Phase [0-9]+.[0-9]+.[0-9]+.+$", "magenta", "bold" ],
[ "^Phase [0-9]+.[0-9]+.+$", "magenta", "bold" ],
[ "^Phase [0-9]+.+$", "magenta", "bold" ]
]

612
colout_logo.svg Normal file
View file

@ -0,0 +1,612 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="1280"
height="640"
viewBox="0 0 338.66666 169.33333"
version="1.1"
id="svg5"
inkscape:version="1.2 (1:1.2.1+202207142221+cd75a1ee6d)"
sodipodi:docname="colout_logo.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<title
id="title3134">colout logo</title>
<sodipodi:namedview
id="namedview7"
pagecolor="white"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="true"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
showguides="true"
inkscape:zoom="0.49573799"
inkscape:cx="1240.5747"
inkscape:cy="978.33938"
inkscape:current-layer="g1398" />
<defs
id="defs2">
<linearGradient
inkscape:collect="always"
id="linearGradient3414">
<stop
style="stop-color:white;stop-opacity:1"
offset="0"
id="stop3410" />
<stop
style="stop-color:#c1c1c1;stop-opacity:1"
offset="1"
id="stop3412" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient1157">
<stop
style="stop-color:#d9d9d9;stop-opacity:1"
offset="0"
id="stop1153" />
<stop
style="stop-color:white;stop-opacity:1"
offset="1"
id="stop1155" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient1157"
id="linearGradient1159"
x1="70.342537"
y1="55.883667"
x2="70.342537"
y2="33.483295"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient1157"
id="linearGradient1159-3"
x1="70.342537"
y1="55.883667"
x2="70.342537"
y2="33.483295"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-1,0,0,1,167.70458,-17.765667)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient1157"
id="linearGradient1246"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-1,0,0,1,167.70458,-17.765667)"
x1="70.342537"
y1="55.883667"
x2="70.342537"
y2="33.483295" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient1157"
id="linearGradient1321"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-1,0,0,1,167.70458,-17.765667)"
x1="70.342537"
y1="55.883667"
x2="70.342537"
y2="33.483295" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient1157"
id="linearGradient1335"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-1,0,0,1,167.70458,-17.765667)"
x1="70.342537"
y1="55.883667"
x2="70.342537"
y2="33.483295" />
<filter
inkscape:collect="always"
style="color-interpolation-filters:sRGB"
id="filter1612"
x="-0.56426269"
y="-0.059691916"
width="2.1285254"
height="1.1193838">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="3.5876859"
id="feGaussianBlur1614" />
</filter>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3414"
id="linearGradient3416"
x1="168.13799"
y1="84.666664"
x2="176.27618"
y2="84.666664"
gradientUnits="userSpaceOnUse" />
</defs>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1">
<rect
style="fill:#1a1a1a;fill-opacity:1;stroke:black;stroke-width:1.32292;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
id="rect3078"
width="336.68741"
height="168.33986"
x="1.3177924"
y="0.66145998"
rx="11.497324"
ry="11.497324" />
<g
id="g1398"
transform="matrix(0.7420285,0,0,0.74139534,45.207765,28.911744)"
style="stroke-width:1.34823">
<g
id="g1173"
transform="translate(0,-3.1913183)"
style="stroke-width:1.34823">
<g
id="g1126"
style="stroke-width:1.34823">
<path
id="rect296"
style="fill:url(#linearGradient1159);fill-opacity:1;stroke:#666;stroke-width:1.7836;stroke-linecap:round"
d="M 58.237147,33.483295 H 70.342538 V 55.883668 H 58.237147 C 54.010226,55.883668 50.607326,52.480768 50.607326,48.253848 V 41.113115 C 50.607326,36.886195 54.010226,33.483295 58.237147,33.483295 Z"
sodipodi:nodetypes="sccssss" />
<rect
style="fill:#e6e6e6;stroke:#666;stroke-width:1.7836;stroke-linecap:round;stroke-dasharray:none"
id="rect1116"
width="91.36097"
height="7.4667912"
x="70.342537"
y="33.483295"
rx="0"
ry="0" />
<rect
style="fill:#ccc;stroke:#666;stroke-width:1.7836;stroke-linecap:round;stroke-dasharray:none"
id="rect1118"
width="91.36097"
height="7.4667912"
x="70.342537"
y="40.950089"
rx="0"
ry="0" />
<rect
style="fill:#b3b3b3;stroke:#666;stroke-width:1.7836;stroke-linecap:round;stroke-dasharray:none"
id="rect1120"
width="91.36097"
height="7.4667912"
x="70.342537"
y="48.416878"
rx="0"
ry="0" />
</g>
<use
x="0"
y="0"
xlink:href="#g1126"
id="use1128"
transform="translate(0,28.783002)"
style="stroke-width:1.34823" />
<use
x="0"
y="0"
xlink:href="#g1126"
id="use1161"
transform="translate(0,57.566004)"
style="stroke-width:1.34823" />
<use
x="0"
y="0"
xlink:href="#g1126"
id="use1163"
transform="translate(0,86.349006)"
style="stroke-width:1.34823" />
</g>
<g
id="g1361"
style="stroke-width:1.34823">
<g
id="g1126-5"
transform="translate(170.96209,14.57435)"
style="stroke:#d40000;stroke-width:1.34823">
<path
id="rect296-3"
style="fill:url(#linearGradient1159-3);fill-opacity:1;stroke:#d40000;stroke-width:1.7836;stroke-linecap:round;stroke-linejoin:round"
d="M 97.362031,15.717629 V 38.118002 L 128.91723,26.917816 Z"
sodipodi:nodetypes="cccc" />
<rect
style="fill:#faa;stroke:#d40000;stroke-width:1.7836;stroke-linecap:round;stroke-dasharray:none"
id="rect1116-5"
width="91.36097"
height="7.4667912"
x="6.0010571"
y="15.717628"
rx="0"
ry="0" />
<rect
style="fill:#f55;stroke:#d40000;stroke-width:1.7836;stroke-linecap:round;stroke-dasharray:none"
id="rect1118-6"
width="91.36097"
height="7.4667912"
x="6.0010571"
y="23.18442"
rx="0"
ry="0" />
<rect
style="fill:red;stroke:#d40000;stroke-width:1.7836;stroke-linecap:round;stroke-dasharray:none"
id="rect1120-2"
width="91.36097"
height="7.4667912"
x="6.0010571"
y="30.651209"
rx="0"
ry="0" />
<path
id="path1230"
style="fill:red;fill-opacity:1;stroke:red;stroke-width:1.7836;stroke-linecap:round;stroke-linejoin:round"
d="M 116.47568,31.333815 L 128.91723,26.917816 L 116.46713,22.498783 Z"
sodipodi:nodetypes="cccc" />
</g>
<g
id="g1244"
transform="translate(170.96209,43.357352)"
style="stroke:#d40000;stroke-width:1.34823">
<path
id="path1234"
style="fill:url(#linearGradient1246);fill-opacity:1;stroke:#d45500;stroke-width:1.7836;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
d="M 97.362031,15.717629 V 38.118002 L 128.91723,26.917816 Z"
sodipodi:nodetypes="cccc" />
<rect
style="fill:#fca;stroke:#d45500;stroke-width:1.7836;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1"
id="rect1236"
width="91.36097"
height="7.4667912"
x="6.0010571"
y="15.717628"
rx="0"
ry="0" />
<rect
style="fill:#f95;stroke:#d45500;stroke-width:1.7836;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1"
id="rect1238"
width="91.36097"
height="7.4667912"
x="6.0010571"
y="23.18442"
rx="0"
ry="0" />
<rect
style="fill:#f60;stroke:#d45500;stroke-width:1.7836;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1"
id="rect1240"
width="91.36097"
height="7.4667912"
x="6.0010571"
y="30.651209"
rx="0"
ry="0" />
<path
id="path1242"
style="fill:#f60;fill-opacity:1;stroke:#f60;stroke-width:1.7836;stroke-linecap:round;stroke-linejoin:round"
d="M 116.47568,31.333815 L 128.91723,26.917816 L 116.46713,22.498783 Z"
sodipodi:nodetypes="cccc" />
</g>
<g
id="g1319"
transform="translate(170.96209,72.140354)"
style="stroke:#d40000;stroke-width:1.34823">
<path
id="path1309"
style="fill:url(#linearGradient1321);fill-opacity:1;stroke:#d48f00;stroke-width:1.7836;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
d="M 97.362031,15.717629 V 38.118002 L 128.91723,26.917816 Z"
sodipodi:nodetypes="cccc" />
<rect
style="fill:#fea;stroke:#d48f00;stroke-width:1.7836;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1"
id="rect1311"
width="91.36097"
height="7.4667912"
x="6.0010571"
y="15.717628"
rx="0"
ry="0" />
<rect
style="fill:#fd5;stroke:#d48f00;stroke-width:1.7836;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1"
id="rect1313"
width="91.36097"
height="7.4667912"
x="6.0010571"
y="23.18442"
rx="0"
ry="0" />
<rect
style="fill:#fc0;stroke:#d48f00;stroke-width:1.7836;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1"
id="rect1315"
width="91.36097"
height="7.4667912"
x="6.0010571"
y="30.651209"
rx="0"
ry="0" />
<path
id="path1317"
style="fill:#fc0;fill-opacity:1;stroke:#fc0;stroke-width:1.7836;stroke-linecap:round;stroke-linejoin:round"
d="M 116.47568,31.333815 L 128.91723,26.917816 L 116.46713,22.498783 Z"
sodipodi:nodetypes="cccc" />
</g>
<g
id="g1333"
transform="translate(170.96209,100.92336)"
style="stroke:#d40000;stroke-width:1.34823">
<path
id="path1323"
style="fill:url(#linearGradient1335);fill-opacity:1;stroke:#8a0;stroke-width:1.7836;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
d="M 97.362031,15.717629 V 38.118002 L 128.91723,26.917816 Z"
sodipodi:nodetypes="cccc" />
<rect
style="fill:#e5ff80;stroke:#8a0;stroke-width:1.7836;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1"
id="rect1325"
width="91.36097"
height="7.4667912"
x="6.0010571"
y="15.717628"
rx="0"
ry="0" />
<rect
style="fill:#d4ff2a;stroke:#8a0;stroke-width:1.7836;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1"
id="rect1327"
width="91.36097"
height="7.4667912"
x="6.0010571"
y="23.18442"
rx="0"
ry="0" />
<rect
style="fill:#aad400;stroke:#8a0;stroke-width:1.7836;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1"
id="rect1329"
width="91.36097"
height="7.4667912"
x="6.0010571"
y="30.651209"
rx="0"
ry="0" />
<path
id="path1331"
style="fill:#aad400;fill-opacity:1;stroke:#aad400;stroke-width:1.7836;stroke-linecap:round;stroke-linejoin:round"
d="M 116.47568,31.333815 L 128.91723,26.917816 L 116.46713,22.498783 Z"
sodipodi:nodetypes="cccc" />
</g>
</g>
<rect
style="fill:black;fill-opacity:1;stroke:none;stroke-width:0.71344;stroke-linecap:round;stroke-opacity:1;filter:url(#filter1612)"
id="rect1610"
width="15.259641"
height="144.24811"
x="165.26918"
y="16.11133"
rx="10.282382"
ry="10.291163" />
<rect
style="fill:url(#linearGradient3416);stroke:none;stroke-width:0.71344;stroke-linecap:round;fill-opacity:1"
id="rect294"
width="15.259641"
height="144.24811"
x="161.70351"
y="12.542613"
rx="7.6298203"
ry="7.6298203" />
</g>
<g
aria-label="stream|colout"
id="text1454"
style="font-weight:bold;font-size:25.4px;line-height:1.1;font-family:'MesloLGS NF';-inkscape-font-specification:'MesloLGS NF Bold';text-align:end;text-anchor:end;fill:white;stroke:none;stroke-width:1.32292;stroke-linecap:round;stroke-linejoin:round">
<path
d="M 83.797238,11.133169 V 14.308169 Q 82.792648,13.663247 81.701242,13.340787 Q 80.622238,13.005923 79.530832,13.005923 Q 78.315402,13.005923 77.695285,13.365591 Q 77.075168,13.712857 77.075168,14.407388 Q 77.075168,15.399576 79.729269,16.019693 L 79.865695,16.0569 L 80.907492,16.304947 Q 82.891867,16.776236 83.80964,17.830435 Q 84.739816,18.872232 84.739816,20.658169 Q 84.739816,22.803775 83.325949,23.882779 Q 81.924484,24.94938 79.09675,24.94938 Q 77.844113,24.94938 76.529465,24.726138 Q 75.214816,24.515298 73.862961,24.081216 V 20.906216 Q 75.065988,21.588345 76.306222,21.948013 Q 77.558859,22.307681 78.724679,22.307681 Q 80.002121,22.307681 80.659445,21.935611 Q 81.316769,21.56354 81.316769,20.856607 Q 81.316769,20.162075 80.84548,19.790005 Q 80.386593,19.417935 78.637863,18.996255 L 77.633273,18.773013 Q 75.549679,18.301724 74.594699,17.297134 Q 73.639719,16.292544 73.639719,14.605826 Q 73.639719,12.596646 75.090793,11.480435 Q 76.541867,10.364224 79.171164,10.364224 Q 80.349386,10.364224 81.515207,10.562662 Q 82.693429,10.748697 83.797238,11.133169 Z"
style="fill:gray;stroke:none"
id="path3282" />
<path
d="M 95.356222,6.7551421 V 10.699087 H 100.10632 V 13.489615 H 95.356222 V 20.062857 Q 95.356222,20.993033 95.802706,21.40231 Q 96.261593,21.799185 97.315792,21.799185 H 100.10632 V 24.589712 H 97.055343 Q 93.929952,24.589712 92.826144,23.597525 Q 91.722335,22.592935 91.722335,19.889224 V 13.489615 H 88.175265 V 10.699087 H 91.722335 V 6.7551421 Z"
style="fill:gray;stroke:none"
id="path3284" />
<path
d="M 116.36579,14.531412 Q 115.77048,13.985708 114.96433,13.712857 Q 114.17058,13.440005 113.2156,13.440005 Q 112.06218,13.440005 111.19401,13.849283 Q 110.33825,14.246158 109.86696,15.015103 Q 109.56931,15.486392 109.44528,16.156119 Q 109.33366,16.825845 109.33366,18.190103 V 24.589712 H 105.69978 V 10.699087 H 109.33366 V 12.857095 Q 109.86696,11.66647 110.97077,11.021548 Q 112.07458,10.364224 113.55046,10.364224 Q 114.2946,10.364224 115.00153,10.550259 Q 115.72087,10.723892 116.36579,11.071158 Z"
style="fill:gray;stroke:none"
id="path3286" />
<path
d="M 131.05016,23.907583 Q 129.78513,24.428482 128.47048,24.688931 Q 127.15583,24.94938 125.69235,24.94938 Q 122.20729,24.94938 120.35934,23.089029 Q 118.5238,21.216275 118.5238,17.706411 Q 118.5238,14.308169 120.29733,12.336197 Q 122.07087,10.364224 125.13425,10.364224 Q 128.22243,10.364224 129.92155,12.199771 Q 131.63307,14.022915 131.63307,17.346744 V 18.822622 H 122.2197 Q 122.2321,20.459732 123.18708,21.265884 Q 124.14206,22.072036 126.03962,22.072036 Q 127.29225,22.072036 128.50768,21.712368 Q 129.72311,21.3527 131.05016,20.571353 Z M 127.97438,16.094107 Q 127.94958,14.655435 127.23024,13.923697 Q 126.52331,13.179556 125.13425,13.179556 Q 123.88161,13.179556 123.13747,13.948501 Q 122.39333,14.705044 122.2569,16.106509 Z"
style="fill:gray;stroke:none"
id="path3288" />
<path
d="M 141.35651,18.066079 Q 139.32253,18.066079 138.51638,18.586978 Q 137.71022,19.107876 137.71022,20.372915 Q 137.71022,21.315493 138.26833,21.873599 Q 138.82644,22.431704 139.78142,22.431704 Q 141.22009,22.431704 142.01384,21.3527 Q 142.80759,20.261294 142.80759,18.314126 V 18.066079 Z M 146.41667,16.664615 V 24.589712 H 142.80759 V 23.039419 Q 142.15026,23.957193 141.12087,24.453286 Q 140.09147,24.94938 138.85124,24.94938 Q 136.48239,24.94938 135.15534,23.696743 Q 133.84069,22.444107 133.84069,20.199283 Q 133.84069,17.768423 135.41579,16.615005 Q 136.99089,15.449185 140.28991,15.449185 H 142.80759 V 14.84147 Q 142.80759,13.960904 142.16267,13.514419 Q 141.53015,13.055533 140.28991,13.055533 Q 138.98767,13.055533 137.75983,13.390396 Q 136.5444,13.712857 135.21735,14.432193 V 11.331607 Q 136.42038,10.835513 137.66062,10.599869 Q 138.90085,10.364224 140.28991,10.364224 Q 143.67575,10.364224 145.04001,11.740884 Q 146.41667,13.117544 146.41667,16.664615 Z"
style="fill:gray;stroke:none"
id="path3290" />
<path
d="M 156.52458,12.08815 Q 156.93386,11.207583 157.56638,10.785904 Q 158.1989,10.364224 159.11667,10.364224 Q 160.91501,10.364224 161.59714,11.604458 Q 162.29167,12.844693 162.29167,16.763833 V 24.589712 H 159.31511 V 15.672427 Q 159.31511,14.122134 159.07946,13.601236 Q 158.84382,13.080337 158.2237,13.080337 Q 157.60359,13.080337 157.35554,13.613638 Q 157.10749,14.146939 157.10749,15.672427 V 24.589712 H 154.16814 V 15.672427 Q 154.16814,14.146939 153.92009,13.613638 Q 153.67204,13.080337 153.05193,13.080337 Q 152.43181,13.080337 152.19616,13.601236 Q 151.96052,14.122134 151.96052,15.672427 V 24.589712 H 148.98396 V 10.699087 H 151.62566 V 12.137759 Q 151.93571,11.319205 152.61784,10.847915 Q 153.29997,10.364224 154.14333,10.364224 Q 154.98669,10.364224 155.68122,10.87272 Q 156.37575,11.368814 156.52458,12.08815 Z"
style="fill:gray;stroke:none"
id="path3292" />
<path
d="M 172.30036,5.2916656 V 30.691665 H 169.48502 V 5.2916656 Z"
style="stroke:none"
id="path3294" />
<path
d="M 191.71003,23.882779 Q 190.79225,24.416079 189.73805,24.676529 Q 188.68385,24.94938 187.46842,24.94938 Q 184.25622,24.94938 182.44548,23.014615 Q 180.63473,21.079849 180.63473,17.656802 Q 180.63473,14.221353 182.45788,12.286587 Q 184.28102,10.339419 187.49323,10.339419 Q 188.60944,10.339419 189.63883,10.599869 Q 190.68063,10.860318 191.71003,11.406021 V 14.729849 Q 190.91628,14.04772 189.9613,13.688052 Q 189.01872,13.315982 188.00173,13.315982 Q 186.22819,13.315982 185.27321,14.444595 Q 184.31823,15.573208 184.31823,17.656802 Q 184.31823,19.740396 185.27321,20.856607 Q 186.22819,21.972818 188.00173,21.972818 Q 189.05592,21.972818 189.9737,21.625552 Q 190.89147,21.265884 191.71003,20.546548 Z"
style="fill:red;stroke:none"
id="path3296" />
<path
d="M 201.48307,13.315982 Q 200.18083,13.315982 199.43669,14.4694 Q 198.69255,15.610415 198.69255,17.656802 Q 198.69255,19.703189 199.43669,20.856607 Q 200.18083,21.997622 201.48307,21.997622 Q 202.79772,21.997622 203.54186,20.856607 Q 204.286,19.703189 204.286,17.656802 Q 204.286,15.610415 203.54186,14.4694 Q 202.79772,13.315982 201.48307,13.315982 Z M 195.05866,17.656802 Q 195.05866,14.295767 196.79499,12.336197 Q 198.54372,10.364224 201.48307,10.364224 Q 204.43483,10.364224 206.17116,12.336197 Q 207.91989,14.295767 207.91989,17.656802 Q 207.91989,21.017837 206.17116,22.98981 Q 204.43483,24.94938 201.48307,24.94938 Q 198.54372,24.94938 196.79499,22.98981 Q 195.05866,21.017837 195.05866,17.656802 Z"
style="fill:#f60;stroke:none"
id="path3298" />
<path
d="M 213.93502,18.797818 V 8.0821929 H 210.25153 V 5.2916656 H 217.56891 V 18.797818 Q 217.56891,20.434927 218.0774,21.117056 Q 218.5859,21.799185 219.80133,21.799185 H 222.70348 V 24.589712 H 218.78434 Q 216.19225,24.589712 215.06364,23.250259 Q 213.93502,21.910806 213.93502,18.797818 Z"
style="fill:#fc0;stroke:none"
id="path3300" />
<path
d="M 232.06726,13.315982 Q 230.76501,13.315982 230.02087,14.4694 Q 229.27673,15.610415 229.27673,17.656802 Q 229.27673,19.703189 230.02087,20.856607 Q 230.76501,21.997622 232.06726,21.997622 Q 233.38191,21.997622 234.12605,20.856607 Q 234.87019,19.703189 234.87019,17.656802 Q 234.87019,15.610415 234.12605,14.4694 Q 233.38191,13.315982 232.06726,13.315982 Z M 225.64284,17.656802 Q 225.64284,14.295767 227.37917,12.336197 Q 229.1279,10.364224 232.06726,10.364224 Q 235.01902,10.364224 236.75534,12.336197 Q 238.50407,14.295767 238.50407,17.656802 Q 238.50407,21.017837 236.75534,22.98981 Q 235.01902,24.94938 232.06726,24.94938 Q 229.1279,24.94938 227.37917,22.98981 Q 225.64284,21.017837 225.64284,17.656802 Z"
style="fill:#cf0;stroke:none"
id="path3302" />
<path
d="M 241.70387,19.740396 V 10.699087 H 245.33776 V 19.18229 Q 245.33776,20.682974 245.75944,21.327896 Q 246.18112,21.972818 247.1609,21.972818 Q 248.14069,21.972818 248.68639,21.104654 Q 249.2445,20.23649 249.2445,18.673794 V 10.699087 H 252.87838 V 24.589712 H 249.2445 V 22.530923 Q 248.86002,23.684341 247.92985,24.316861 Q 247.01208,24.94938 245.70983,24.94938 Q 243.72545,24.94938 242.70846,23.634732 Q 241.70387,22.320083 241.70387,19.740396 Z"
style="fill:lime;stroke:none"
id="path3304" />
<path
d="M 263.5692,6.7551421 V 10.699087 H 268.3193 V 13.489615 H 263.5692 V 20.062857 Q 263.5692,20.993033 264.01568,21.40231 Q 264.47457,21.799185 265.52877,21.799185 H 268.3193 V 24.589712 H 265.26832 Q 262.14293,24.589712 261.03912,23.597525 Q 259.93531,22.592935 259.93531,19.889224 V 13.489615 H 256.38824 V 10.699087 H 259.93531 V 6.7551421 Z"
style="fill:#0fc;stroke:none"
id="path3306" />
</g>
<g
aria-label="Color text streams with a polished CLI"
id="text2922"
style="font-size:13.5744px;line-height:1.1;font-family:'MesloLGS NF';-inkscape-font-specification:'MesloLGS NF';text-align:end;text-anchor:end;fill:gray;fill-opacity:0.620767;stroke:white;stroke-width:1.32292;stroke-linecap:round;stroke-linejoin:round">
<path
d="M 21.38032,160.64055 Q 20.869955,160.9123 20.333077,161.04486 Q 19.796198,161.18405 19.193039,161.18405 Q 17.290767,161.18405 16.236895,159.83854 Q 15.189652,158.49303 15.189652,156.05388 Q 15.189652,153.62799 16.243523,152.27585 Q 17.304023,150.91709 19.193039,150.91709 Q 19.796198,150.91709 20.333077,151.05628 Q 20.869955,151.18884 21.38032,151.46059 V 152.83261 Q 20.889839,152.4283 20.326448,152.2162 Q 19.763058,152.0041 19.193039,152.0041 Q 17.887298,152.0041 17.237742,153.01157 Q 16.588186,154.01905 16.588186,156.05388 Q 16.588186,158.08209 17.237742,159.08956 Q 17.887298,160.09704 19.193039,160.09704 Q 19.776314,160.09704 20.333077,159.88494 Q 20.896467,159.67284 21.38032,159.26852 Z"
style="fill:#ccc;stroke:none"
id="path3217" />
<path
d="M 26.523745,154.42336 Q 25.595807,154.42336 25.118582,155.14583 Q 24.641357,155.8683 24.641357,157.28671 Q 24.641357,158.69851 25.118582,159.4276 Q 25.595807,160.15006 26.523745,160.15006 Q 27.458311,160.15006 27.935536,159.4276 Q 28.412761,158.69851 28.412761,157.28671 Q 28.412761,155.8683 27.935536,155.14583 Q 27.458311,154.42336 26.523745,154.42336 Z M 26.523745,153.38938 Q 28.068098,153.38938 28.883357,154.39022 Q 29.705245,155.39107 29.705245,157.28671 Q 29.705245,159.18899 28.889986,160.18983 Q 28.074726,161.18405 26.523745,161.18405 Q 24.979392,161.18405 24.164132,160.18983 Q 23.348873,159.18899 23.348873,157.28671 Q 23.348873,155.39107 24.164132,154.39022 Q 24.979392,153.38938 26.523745,153.38938 Z"
style="fill:#ccc;stroke:none"
id="path3219" />
<path
d="M 35.37892,158.30745 Q 35.37892,159.12933 35.677185,159.54691 Q 35.982079,159.96448 36.571982,159.96448 H 37.997029 V 160.99184 H 36.452676 Q 35.359035,160.99184 34.755876,160.29588 Q 34.159345,159.5933 34.159345,158.30745 V 151.59316 H 32.204048 V 150.63871 H 35.37892 Z"
style="fill:#ccc;stroke:none"
id="path3221" />
<path
d="M 42.8687,154.42336 Q 41.940763,154.42336 41.463538,155.14583 Q 40.986313,155.8683 40.986313,157.28671 Q 40.986313,158.69851 41.463538,159.4276 Q 41.940763,160.15006 42.8687,160.15006 Q 43.803266,160.15006 44.280491,159.4276 Q 44.757716,158.69851 44.757716,157.28671 Q 44.757716,155.8683 44.280491,155.14583 Q 43.803266,154.42336 42.8687,154.42336 Z M 42.8687,153.38938 Q 44.413053,153.38938 45.228313,154.39022 Q 46.0502,155.39107 46.0502,157.28671 Q 46.0502,159.18899 45.234941,160.18983 Q 44.419682,161.18405 42.8687,161.18405 Q 41.324347,161.18405 40.509088,160.18983 Q 39.693828,159.18899 39.693828,157.28671 Q 39.693828,155.39107 40.509088,154.39022 Q 41.324347,153.38938 42.8687,153.38938 Z"
style="fill:#ccc;stroke:none"
id="path3223" />
<path
d="M 54.613737,155.09943 Q 54.222678,154.79454 53.818362,154.65535 Q 53.414047,154.51616 52.930194,154.51616 Q 51.790156,154.51616 51.186997,155.232 Q 50.583837,155.94783 50.583837,157.29997 V 160.99184 H 49.357634 V 153.56834 H 50.583837 V 155.0199 Q 50.888731,154.23115 51.518403,153.81358 Q 52.154703,153.38938 53.022987,153.38938 Q 53.4737,153.38938 53.864759,153.50206 Q 54.255819,153.61473 54.613737,153.85335 Z"
style="fill:#ccc;stroke:none"
id="path3225" />
<path
d="M 67.372877,151.46059 V 153.56834 H 70.143434 V 154.51616 H 67.372877 V 158.54606 Q 67.372877,159.36795 67.684399,159.69272 Q 67.995921,160.0175 68.771412,160.0175 H 70.143434 V 160.99184 H 68.652105 Q 67.280084,160.99184 66.716693,160.4417 Q 66.153302,159.89157 66.153302,158.54606 V 154.51616 H 64.171493 V 153.56834 H 66.153302 V 151.46059 Z"
style="fill:#ccc;stroke:none"
id="path3227" />
<path
d="M 78.899186,156.6703 V 157.26683 H 73.616571 V 157.3066 Q 73.563546,158.82444 74.193217,159.48725 Q 74.829517,160.15006 75.982811,160.15006 Q 76.566086,160.15006 77.202386,159.96448 Q 77.838686,159.77889 78.561152,159.40109 V 160.61403 Q 77.865199,160.89904 77.215642,161.03823 Q 76.572714,161.18405 75.969555,161.18405 Q 74.239614,161.18405 73.26528,160.15006 Q 72.290946,159.10945 72.290946,157.28671 Q 72.290946,155.51038 73.245396,154.44988 Q 74.199846,153.38938 75.790596,153.38938 Q 77.209014,153.38938 78.024274,154.35046 Q 78.846161,155.31153 78.899186,156.6703 Z M 77.679611,156.31238 Q 77.600074,155.54352 77.116221,154.98676 Q 76.638996,154.42336 75.737571,154.42336 Q 74.85603,154.42336 74.286011,155.00664 Q 73.715992,155.58991 73.662967,156.31901 Z"
style="fill:#ccc;stroke:none"
id="path3229" />
<path
d="M 87.058408,153.56834 L 84.40053,157.12101 L 87.316905,160.99184 H 85.905114 L 83.731089,158.01581 L 81.563692,160.99184 H 80.151901 L 83.068276,157.12101 L 80.410398,153.56834 H 81.762536 L 83.731089,156.25273 L 85.686386,153.56834 Z"
style="fill:#ccc;stroke:none"
id="path3231" />
<path
d="M 91.89031,151.46059 V 153.56834 H 94.660867 V 154.51616 H 91.89031 V 158.54606 Q 91.89031,159.36795 92.201832,159.69272 Q 92.513354,160.0175 93.288845,160.0175 H 94.660867 V 160.99184 H 93.169539 Q 91.797517,160.99184 91.234126,160.4417 Q 90.670735,159.89157 90.670735,158.54606 V 154.51616 H 88.688926 V 153.56834 H 90.670735 V 151.46059 Z"
style="fill:#ccc;stroke:none"
id="path3233" />
<path
d="M 110.61476,153.82683 V 155.0199 Q 110.09114,154.715 109.56089,154.56256 Q 109.03064,154.41011 108.48051,154.41011 Q 107.65199,154.41011 107.24105,154.68186 Q 106.83673,154.94699 106.83673,155.49712 Q 106.83673,155.99423 107.14163,156.23947 Q 107.44652,156.48471 108.65947,156.7167 L 109.14995,156.80949 Q 110.058,156.98182 110.52197,157.49881 Q 110.99257,158.01581 110.99257,158.84432 Q 110.99257,159.94459 110.21045,160.56764 Q 109.42833,161.18405 108.03642,161.18405 Q 107.48629,161.18405 106.88313,161.06475 Q 106.27997,160.95207 105.57739,160.72008 V 159.46074 Q 106.26008,159.81203 106.88313,159.99099 Q 107.50617,160.16332 108.06293,160.16332 Q 108.87157,160.16332 109.31565,159.83854 Q 109.75973,159.50714 109.75973,158.91723 Q 109.75973,158.06883 108.13584,157.74406 L 108.08282,157.7308 L 107.62548,157.63801 Q 106.57161,157.43253 106.08775,156.94868 Q 105.6039,156.4582 105.6039,155.61643 Q 105.6039,154.5493 106.32637,153.97265 Q 107.04883,153.38938 108.38771,153.38938 Q 108.98424,153.38938 109.53438,153.50206 Q 110.08451,153.60811 110.61476,153.82683 Z"
style="fill:#ccc;stroke:none"
id="path3235" />
<path
d="M 116.40774,151.46059 V 153.56834 H 119.1783 V 154.51616 H 116.40774 V 158.54606 Q 116.40774,159.36795 116.71927,159.69272 Q 117.03079,160.0175 117.80628,160.0175 H 119.1783 V 160.99184 H 117.68697 Q 116.31495,160.99184 115.75156,160.4417 Q 115.18817,159.89157 115.18817,158.54606 V 154.51616 H 113.20636 V 153.56834 H 115.18817 V 151.46059 Z"
style="fill:#ccc;stroke:none"
id="path3237" />
<path
d="M 128.16604,155.09943 Q 127.77498,154.79454 127.37066,154.65535 Q 126.96635,154.51616 126.48249,154.51616 Q 125.34246,154.51616 124.7393,155.232 Q 124.13614,155.94783 124.13614,157.29997 V 160.99184 H 122.90993 V 153.56834 H 124.13614 V 155.0199 Q 124.44103,154.23115 125.0707,153.81358 Q 125.707,153.38938 126.57529,153.38938 Q 127.026,153.38938 127.41706,153.50206 Q 127.80812,153.61473 128.16604,153.85335 Z"
style="fill:#ccc;stroke:none"
id="path3239" />
<path
d="M 136.10653,156.6703 V 157.26683 H 130.82391 V 157.3066 Q 130.77089,158.82444 131.40056,159.48725 Q 132.03686,160.15006 133.19016,160.15006 Q 133.77343,160.15006 134.40973,159.96448 Q 135.04603,159.77889 135.7685,159.40109 V 160.61403 Q 135.07254,160.89904 134.42299,161.03823 Q 133.78006,161.18405 133.1769,161.18405 Q 131.44696,161.18405 130.47262,160.15006 Q 129.49829,159.10945 129.49829,157.28671 Q 129.49829,155.51038 130.45274,154.44988 Q 131.40719,153.38938 132.99794,153.38938 Q 134.41636,153.38938 135.23162,154.35046 Q 136.05351,155.31153 136.10653,156.6703 Z M 134.88696,156.31238 Q 134.80742,155.54352 134.32356,154.98676 Q 133.84634,154.42336 132.94491,154.42336 Q 132.06337,154.42336 131.49336,155.00664 Q 130.92334,155.58991 130.87031,156.31901 Z"
style="fill:#ccc;stroke:none"
id="path3241" />
<path
d="M 141.50845,157.2602 H 141.10414 Q 140.03701,157.2602 139.4935,157.63801 Q 138.95662,158.00918 138.95662,158.75153 Q 138.95662,159.42097 139.36094,159.79215 Q 139.76525,160.16332 140.48109,160.16332 Q 141.48857,160.16332 142.06521,159.46737 Q 142.64186,158.76479 142.64849,157.53196 V 157.2602 Z M 143.87469,156.75646 V 160.99184 H 142.64849 V 159.89157 Q 142.25743,160.55438 141.6609,160.87253 Q 141.071,161.18405 140.2226,161.18405 Q 139.08919,161.18405 138.41312,160.54775 Q 137.73705,159.90482 137.73705,158.83107 Q 137.73705,157.59161 138.56556,156.94868 Q 139.40071,156.30575 141.01134,156.30575 H 142.64849 V 156.11354 Q 142.64186,155.22537 142.19778,154.82768 Q 141.75369,154.42336 140.77936,154.42336 Q 140.15631,154.42336 139.52001,154.60232 Q 138.88371,154.78128 138.28055,155.12595 V 153.90637 Q 138.95662,153.64787 139.57304,153.52194 Q 140.19608,153.38938 140.77936,153.38938 Q 141.70067,153.38938 142.35022,153.66113 Q 143.00641,153.93288 143.41072,154.47639 Q 143.66259,154.8078 143.76864,155.29828 Q 143.87469,155.78213 143.87469,156.75646 Z"
style="fill:#ccc;stroke:none"
id="path3243" />
<path
d="M 149.5086,154.32394 Q 149.73395,153.84672 150.07862,153.62136 Q 150.42991,153.38938 150.92039,153.38938 Q 151.81519,153.38938 152.17973,154.08533 Q 152.55091,154.77466 152.55091,156.69018 V 160.99184 H 151.43738 V 156.74321 Q 151.43738,155.17234 151.25842,154.79454 Q 151.08609,154.41011 150.62212,154.41011 Q 150.09187,154.41011 149.89303,154.82105 Q 149.70081,155.22537 149.70081,156.74321 V 160.99184 H 148.58729 V 156.74321 Q 148.58729,155.15246 148.39507,154.78128 Q 148.20949,154.41011 147.719,154.41011 Q 147.23515,154.41011 147.04294,154.82105 Q 146.85735,155.22537 146.85735,156.74321 V 160.99184 H 145.75045 V 153.56834 H 146.85735 V 154.20464 Q 147.07608,153.80695 147.40085,153.60148 Q 147.73226,153.38938 148.14983,153.38938 Q 148.65357,153.38938 148.98498,153.62136 Q 149.32301,153.85335 149.5086,154.32394 Z"
style="fill:#ccc;stroke:none"
id="path3245" />
<path
d="M 159.64964,153.82683 V 155.0199 Q 159.12601,154.715 158.59576,154.56256 Q 158.06551,154.41011 157.51538,154.41011 Q 156.68686,154.41011 156.27592,154.68186 Q 155.87161,154.94699 155.87161,155.49712 Q 155.87161,155.99423 156.1765,156.23947 Q 156.48139,156.48471 157.69434,156.7167 L 158.18482,156.80949 Q 159.09287,156.98182 159.55684,157.49881 Q 160.02744,158.01581 160.02744,158.84432 Q 160.02744,159.94459 159.24532,160.56764 Q 158.4632,161.18405 157.0713,161.18405 Q 156.52116,161.18405 155.918,161.06475 Q 155.31484,160.95207 154.61226,160.72008 V 159.46074 Q 155.29496,159.81203 155.918,159.99099 Q 156.54105,160.16332 157.09781,160.16332 Q 157.90644,160.16332 158.35052,159.83854 Q 158.79461,159.50714 158.79461,158.91723 Q 158.79461,158.06883 157.17072,157.74406 L 157.11769,157.7308 L 156.66035,157.63801 Q 155.60648,157.43253 155.12263,156.94868 Q 154.63877,156.4582 154.63877,155.61643 Q 154.63877,154.5493 155.36124,153.97265 Q 156.08371,153.38938 157.42259,153.38938 Q 158.01912,153.38938 158.56925,153.50206 Q 159.11939,153.60811 159.64964,153.82683 Z"
style="fill:#ccc;stroke:none"
id="path3247" />
<path
d="M 169.54541,153.56834 H 170.75173 L 172.04421,159.56679 L 173.10471,155.73573 H 174.14533 L 175.21909,159.56679 L 176.51157,153.56834 H 177.71789 L 175.98132,160.99184 H 174.81477 L 173.62834,156.92217 L 172.44853,160.99184 H 171.28198 Z"
style="fill:#ccc;stroke:none"
id="path3249" />
<path
d="M 179.81238,153.59485 H 182.93423 V 160.04401 H 185.3535 V 160.99184 H 179.29539 V 160.04401 H 181.71466 V 154.54267 H 179.81238 Z M 181.71466,150.71161 H 182.93423 V 152.24934 H 181.71466 Z"
style="fill:#ccc;stroke:none"
id="path3251" />
<path
d="M 189.96005,151.46059 V 153.56834 H 192.73061 V 154.51616 H 189.96005 V 158.54606 Q 189.96005,159.36795 190.27157,159.69272 Q 190.58309,160.0175 191.35859,160.0175 H 192.73061 V 160.99184 H 191.23928 Q 189.86726,160.99184 189.30387,160.4417 Q 188.74048,159.89157 188.74048,158.54606 V 154.51616 H 186.75867 V 153.56834 H 188.74048 V 151.46059 Z"
style="fill:#ccc;stroke:none"
id="path3253" />
<path
d="M 201.02901,156.39192 V 160.99184 H 199.80281 V 156.39192 Q 199.80281,155.39107 199.45152,154.92047 Q 199.10023,154.44988 198.35125,154.44988 Q 197.49622,154.44988 197.03225,155.05966 Q 196.57491,155.66282 196.57491,156.79623 V 160.99184 H 195.35534 V 150.67847 H 196.57491 V 154.68186 Q 196.89969,154.04556 197.45645,153.72078 Q 198.01321,153.38938 198.77545,153.38938 Q 199.90886,153.38938 200.46562,154.13836 Q 201.02901,154.88071 201.02901,156.39192 Z"
style="fill:#ccc;stroke:none"
id="path3255" />
<path
d="M 215.06075,157.2602 H 214.65644 Q 213.58931,157.2602 213.0458,157.63801 Q 212.50892,158.00918 212.50892,158.75153 Q 212.50892,159.42097 212.91324,159.79215 Q 213.31755,160.16332 214.03339,160.16332 Q 215.04087,160.16332 215.61751,159.46737 Q 216.19416,158.76479 216.20079,157.53196 V 157.2602 Z M 217.42699,156.75646 V 160.99184 H 216.20079 V 159.89157 Q 215.80973,160.55438 215.2132,160.87253 Q 214.6233,161.18405 213.7749,161.18405 Q 212.64149,161.18405 211.96542,160.54775 Q 211.28935,159.90482 211.28935,158.83107 Q 211.28935,157.59161 212.11786,156.94868 Q 212.95301,156.30575 214.56364,156.30575 H 216.20079 V 156.11354 Q 216.19416,155.22537 215.75008,154.82768 Q 215.30599,154.42336 214.33166,154.42336 Q 213.70861,154.42336 213.07231,154.60232 Q 212.43601,154.78128 211.83285,155.12595 V 153.90637 Q 212.50892,153.64787 213.12534,153.52194 Q 213.74838,153.38938 214.33166,153.38938 Q 215.25297,153.38938 215.90252,153.66113 Q 216.55871,153.93288 216.96302,154.47639 Q 217.21489,154.8078 217.32094,155.29828 Q 217.42699,155.78213 217.42699,156.75646 Z"
style="fill:#ccc;stroke:none"
id="path3257" />
<path
d="M 229.23831,160.05727 V 163.81542 H 228.01211 V 153.56834 H 229.23831 V 154.51616 Q 229.5432,153.96602 230.04694,153.68101 Q 230.55731,153.38938 231.22012,153.38938 Q 232.56563,153.38938 233.32786,154.42999 Q 234.09673,155.47061 234.09673,157.31323 Q 234.09673,159.12271 233.32786,160.15669 Q 232.559,161.18405 231.22012,161.18405 Q 230.54405,161.18405 230.03368,160.89904 Q 229.52995,160.60741 229.23831,160.05727 Z M 232.8175,157.28671 Q 232.8175,155.8683 232.36678,155.14583 Q 231.9227,154.42336 231.04116,154.42336 Q 230.15299,154.42336 229.69565,155.15246 Q 229.23831,155.87492 229.23831,157.28671 Q 229.23831,158.69188 229.69565,159.42097 Q 230.15299,160.15006 231.04116,160.15006 Q 231.9227,160.15006 232.36678,159.4276 Q 232.8175,158.70513 232.8175,157.28671 Z"
style="fill:#ccc;stroke:none"
id="path3259" />
<path
d="M 239.00816,154.42336 Q 238.08022,154.42336 237.603,155.14583 Q 237.12577,155.8683 237.12577,157.28671 Q 237.12577,158.69851 237.603,159.4276 Q 238.08022,160.15006 239.00816,160.15006 Q 239.94272,160.15006 240.41995,159.4276 Q 240.89717,158.69851 240.89717,157.28671 Q 240.89717,155.8683 240.41995,155.14583 Q 239.94272,154.42336 239.00816,154.42336 Z M 239.00816,153.38938 Q 240.55251,153.38938 241.36777,154.39022 Q 242.18966,155.39107 242.18966,157.28671 Q 242.18966,159.18899 241.3744,160.18983 Q 240.55914,161.18405 239.00816,161.18405 Q 237.4638,161.18405 236.64855,160.18983 Q 235.83329,159.18899 235.83329,157.28671 Q 235.83329,155.39107 236.64855,154.39022 Q 237.4638,153.38938 239.00816,153.38938 Z"
style="fill:#ccc;stroke:none"
id="path3261" />
<path
d="M 247.86334,158.30745 Q 247.86334,159.12933 248.16161,159.54691 Q 248.4665,159.96448 249.0564,159.96448 H 250.48145 V 160.99184 H 248.9371 Q 247.84346,160.99184 247.2403,160.29588 Q 246.64377,159.5933 246.64377,158.30745 V 151.59316 H 244.68847 V 150.63871 H 247.86334 Z"
style="fill:#ccc;stroke:none"
id="path3263" />
<path
d="M 253.36469,153.59485 H 256.48654 V 160.04401 H 258.9058 V 160.99184 H 252.8477 V 160.04401 H 255.26696 V 154.54267 H 253.36469 Z M 255.26696,150.71161 H 256.48654 V 152.24934 H 255.26696 Z"
style="fill:#ccc;stroke:none"
id="path3265" />
<path
d="M 265.89184,153.82683 V 155.0199 Q 265.36822,154.715 264.83797,154.56256 Q 264.30772,154.41011 263.75758,154.41011 Q 262.92907,154.41011 262.51812,154.68186 Q 262.11381,154.94699 262.11381,155.49712 Q 262.11381,155.99423 262.4187,156.23947 Q 262.7236,156.48471 263.93654,156.7167 L 264.42702,156.80949 Q 265.33508,156.98182 265.79905,157.49881 Q 266.26964,158.01581 266.26964,158.84432 Q 266.26964,159.94459 265.48752,160.56764 Q 264.70541,161.18405 263.3135,161.18405 Q 262.76336,161.18405 262.16021,161.06475 Q 261.55705,160.95207 260.85446,160.72008 V 159.46074 Q 261.53716,159.81203 262.16021,159.99099 Q 262.78325,160.16332 263.34001,160.16332 Q 264.14864,160.16332 264.59273,159.83854 Q 265.03681,159.50714 265.03681,158.91723 Q 265.03681,158.06883 263.41292,157.74406 L 263.3599,157.7308 L 262.90256,157.63801 Q 261.84868,157.43253 261.36483,156.94868 Q 260.88098,156.4582 260.88098,155.61643 Q 260.88098,154.5493 261.60344,153.97265 Q 262.32591,153.38938 263.66479,153.38938 Q 264.26132,153.38938 264.81146,153.50206 Q 265.36159,153.60811 265.89184,153.82683 Z"
style="fill:#ccc;stroke:none"
id="path3267" />
<path
d="M 274.5813,156.39192 V 160.99184 H 273.3551 V 156.39192 Q 273.3551,155.39107 273.00381,154.92047 Q 272.65252,154.44988 271.90354,154.44988 Q 271.04851,154.44988 270.58454,155.05966 Q 270.1272,155.66282 270.1272,156.79623 V 160.99184 H 268.90763 V 150.67847 H 270.1272 V 154.68186 Q 270.45198,154.04556 271.00874,153.72078 Q 271.56551,153.38938 272.32774,153.38938 Q 273.46115,153.38938 274.01791,154.13836 Q 274.5813,154.88071 274.5813,156.39192 Z"
style="fill:#ccc;stroke:none"
id="path3269" />
<path
d="M 283.21113,156.6703 V 157.26683 H 277.92851 V 157.3066 Q 277.87549,158.82444 278.50516,159.48725 Q 279.14146,160.15006 280.29475,160.15006 Q 280.87803,160.15006 281.51433,159.96448 Q 282.15063,159.77889 282.87309,159.40109 V 160.61403 Q 282.17714,160.89904 281.52759,161.03823 Q 280.88466,161.18405 280.2815,161.18405 Q 278.55156,161.18405 277.57722,160.15006 Q 276.60289,159.10945 276.60289,157.28671 Q 276.60289,155.51038 277.55734,154.44988 Q 278.51179,153.38938 280.10254,153.38938 Q 281.52096,153.38938 282.33622,154.35046 Q 283.1581,155.31153 283.21113,156.6703 Z M 281.99155,156.31238 Q 281.91202,155.54352 281.42816,154.98676 Q 280.95094,154.42336 280.04951,154.42336 Q 279.16797,154.42336 278.59795,155.00664 Q 278.02794,155.58991 277.97491,156.31901 Z"
style="fill:#ccc;stroke:none"
id="path3271" />
<path
d="M 289.64705,154.51616 V 150.67847 H 290.86662 V 160.99184 H 289.64705 V 160.05727 Q 289.34215,160.60741 288.83179,160.89904 Q 288.32805,161.18405 287.66524,161.18405 Q 286.31973,161.18405 285.54424,160.14344 Q 284.77537,159.09619 284.77537,157.2602 Q 284.77537,155.45072 285.55086,154.42336 Q 286.32636,153.38938 287.66524,153.38938 Q 288.33468,153.38938 288.84504,153.68101 Q 289.35541,153.96602 289.64705,154.51616 Z M 286.06123,157.28671 Q 286.06123,158.70513 286.51194,159.4276 Q 286.96266,160.15006 287.8442,160.15006 Q 288.72574,160.15006 289.18308,159.42097 Q 289.64705,158.69188 289.64705,157.28671 Q 289.64705,155.87492 289.18308,155.15246 Q 288.72574,154.42336 287.8442,154.42336 Q 286.96266,154.42336 286.51194,155.14583 Q 286.06123,155.8683 286.06123,157.28671 Z"
style="fill:#ccc;stroke:none"
id="path3273" />
<path
d="M 307.41703,160.64055 Q 306.90667,160.9123 306.36979,161.04486 Q 305.83291,161.18405 305.22975,161.18405 Q 303.32748,161.18405 302.27361,159.83854 Q 301.22636,158.49303 301.22636,156.05388 Q 301.22636,153.62799 302.28024,152.27585 Q 303.34074,150.91709 305.22975,150.91709 Q 305.83291,150.91709 306.36979,151.05628 Q 306.90667,151.18884 307.41703,151.46059 V 152.83261 Q 306.92655,152.4283 306.36316,152.2162 Q 305.79977,152.0041 305.22975,152.0041 Q 303.92401,152.0041 303.27445,153.01157 Q 302.6249,154.01905 302.6249,156.05388 Q 302.6249,158.08209 303.27445,159.08956 Q 303.92401,160.09704 305.22975,160.09704 Q 305.81303,160.09704 306.36979,159.88494 Q 306.93318,159.67284 307.41703,159.26852 Z"
style="fill:#ccc;stroke:none"
id="path3275" />
<path
d="M 309.90259,151.09605 H 311.2481 V 159.86506 H 316.02697 V 160.99184 H 309.90259 Z"
style="fill:#ccc;stroke:none"
id="path3277" />
<path
d="M 317.98228,151.09605 H 323.47699 V 152.22283 H 321.40239 V 159.86506 H 323.47699 V 160.99184 H 317.98228 V 159.86506 H 320.05688 V 152.22283 H 317.98228 Z"
style="fill:#ccc;stroke:none"
id="path3279" />
</g>
</g>
<metadata
id="metadata3132">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:title>colout logo</dc:title>
<dc:date>2022-08-31</dc:date>
<dc:creator>
<cc:Agent>
<dc:title>nojhan</dc:title>
</cc:Agent>
</dc:creator>
</cc:Work>
</rdf:RDF>
</metadata>
</svg>

After

Width:  |  Height:  |  Size: 44 KiB

132
example.gdbinit Normal file
View file

@ -0,0 +1,132 @@
set confirm off
# Reversed yellow >>>, underlined green frame name, yellow »»»
set extended-prompt \[\e[7;33m\]>>>\[\e[0m\]\[\] \[\e[4;32m\]\f\[\e[0m\]\[\]\[\e[0;33m\] \n»»» \[\e[0m\]
# Don't wrap line or the coloring regexp won't work.
set width 0
# Create a named pipe to get outputs from gdb
shell test -e /tmp/coloutPipe && rm /tmp/coloutPipe
shell mkfifo /tmp/coloutPipe
define logging_on
# Instead of printing on stdout only, log everything...
set logging redirect on
# ... in our named pipe.
set logging on /tmp/coloutPipe
end
define logging_off
set logging off
set logging redirect off
# Because both gdb and our commands are writing on the same pipe at the same
# time, it is more than probable that gdb will end before our (higher level)
# commands. The gdb prompt will thus render before the result of the command,
# which is highly akward. To prevent this, we need to wait before displaying
# the prompt again. The more your commands are complex, the higher you will
# need to set this.
shell sleep 0.4s
end
define hook-break
# Don't forget to run the command in the background
shell cat /tmp/coloutPipe | colout "(Breakpoint) ([0-9]+) at (0x\S+): file (.+/)([^/]+), line ([0-9]+)." blue,red,cyan,none,white,yellow normal,bold,normal,normal,bold,normal &
# You should start to consume the pipe before actually redirecting the command output into it.
logging_on
end
define hookpost-break
logging_off
end
define hook-run
shell cat /tmp/coloutPipe | colout "^(Program received signal )(.+), (.+).$" yellow,red,yellow normal,bold | colout "^(Breakpoint) ([0-9]+),*\s+(0x\S+ )*(in )*(\S+) (\(.*\)) at (.*/)?(?:$|(.+?)(?:(\.[^.]*)|)):([0-9]+)" red,red,blue,none,green,cpp,none,white,white,yellow normal,bold,normal,normal,bold,normal,normal,bold,bold,bold | colout "^(Starting program): (.*/)?(?:$|(.+?)(?:(\.[^.]*)|)):([0-9]+)" green,none,white,white,yellow normal,normal,bold,bold,bold | colout "^[0-9]+\s+(.*)$" Cpp &
logging_on
end
define hookpost-run
logging_off
end
define hook-continue
shell cat /tmp/coloutPipe | colout "^(Program received signal )(.*)(,.*)$" yellow,red,yellow bold | colout "^(Breakpoint) ([0-9]+),*\s+(0x\S+ )*(in )*(\S+) (\(.*\)) at (.*/)?(?:$|(.+?)(?:(\.[^.]*)|)):([0-9]+)" red,red,blue,none,green,cpp,none,white,white,yellow normal,bold,normal,normal,bold,normal,normal,bold,bold,bold | colout "^[0-9]+\s+(.*)$" Cpp &
logging_on
end
define hookpost-continue
logging_off
end
# Full syntax highlighting for the `list` command.
define hook-list
#shell cat /tmp/coloutPipe | colout --all --source cpp &
shell cat /tmp/coloutPipe | colout "^([0-9]+)\s*(.*)$" red,Cpp &
logging_on
end
# Don't forget the hookpost- or next coloring commands will fail.
define hookpost-list
logging_off
end
define hook-backtrace
# Note: match path = [path]file[.ext] = (.*/)?(?:$|(.+?)(?:(\.[^.]*)|))
# This line color highlights:
# lines that link to source code,
# function call in green,
# arguments names in yellow, values in magenta,
# — the parent directory in bold red (assuming that the debug session would be in a "project/build/" directory).
shell cat /tmp/coloutPipe | colout "^(#)([0-9]+)\s+(0x\S+ )*(in )*(.*) (\(.*\)) (at) (.*/)?(?:$|(.+?)(?:(\.[^.]*)|)):([0-9]+)" red,red,blue,red,green,magenta,red,none,white,white,yellow normal,bold,normal,normal,normal,normal,normal,bold,bold,bold | colout "([\w\s]*?)(=)([^,]*?)([,\)])" yellow,blue,magenta,blue normal | colout "/($(basename $(dirname $(pwd))))/" red bold &
logging_on
end
define hookpost-backtrace
logging_off
end
define info hook-breakpoints
shell cat /tmp/coloutPipe | colout "^([0-9]+)" red bold | colout "\sy\s" green | colout "\sn\s" red | colout "breakpoint" green normal | colout "watchpoint" orange normal | colout "\s0x\S+\s" blue normal | colout "(.*/)?(?:$|(.+?)(?:(\.[^.]*)|)):([0-9]+)$" none,white,white,yellow normal,bold &
logging_on
end
define info hookpost-breakpoints
logging_off
end
define info hook-line
shell cat /tmp/coloutPipe | colout "^Line ([0-9]+) of \"(.*/)?(?:$|(.+?)(?:(\.[^.]*)|))\"" yellow,none,white,white bold | colout "(0x\S+) <(\S+)\+([0-9]+)>" blue,green,blue normal &
logging_on
end
define info hookpost-line
logging_off
end
define hook-frame
#shell cat /tmp/coloutPipe | colout "^(#)([0-9]+)\s+(0x\S+ )*(in )*(.*) (at) (.*/)?(?:$|(.+?)(?:(\.[^.]*)|)):([0-9]+)" red,red,blue,red,green,red,magenta,none,white,white,yellow normal,bold,normal,normal,bold,normal,normal,bold,bold,bold | colout "^([0-9]+)\s+(.*)$" yellow,Cpp &
shell cat /tmp/coloutPipe | colout "^(#)([0-9]+)\s+(0x\S+ )*(in )*(.*) (\(.*\)) (at) (.*/)?(?:$|(.+?)(?:(\.[^.]*)|)):([0-9]+)" red,red,blue,red,green,magenta,red,none,white,white,yellow normal,bold,normal,normal,normal,normal,normal,bold,bold,bold | colout "([\w\s]*?)(=)([^,]*?)([,\)])" yellow,blue,magenta,blue normal &
logging_on
end
define hookpost-frame
logging_off
end
# Don't forget to clean the adhoc pipe.
define hook-quit
set confirm off
shell rm -f /tmp/coloutPipe
end
define hook-display
shell cat /tmp/coloutPipe | colout "^([0-9]+)(:) (.+?) (=) " red,blue,white,blue normal,normal,bold,normal | colout "(@)(0x\S+)(:)" red,blue,red normal &
logging_on
end
define hookpost-display
logging_off
end

3
requirements-build.txt Normal file
View file

@ -0,0 +1,3 @@
tox
tox-wheel
twine

View file

@ -3,35 +3,57 @@
import os
import sys
import colout
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python3 setup.py sdist upload')
os.system('python setup.py bdist_wheel --universal upload')
sys.exit()
packages = ['colout']
requires = ['argparse', 'pygments', 'babel']
requires = ['pygments', 'babel']
setup_requires = ['setuptools_scm']
classifiers = """
Environment :: Console
Development Status :: 5 - Production/Stable
License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Operating System :: POSIX
Operating System :: POSIX :: Linux
Programming Language :: Python :: 3
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Topic :: Utilities
Topic :: Text Processing
Topic :: Text Processing :: Filters
""".strip().split('\n')
setup(
name='colout',
version='0.1',
use_scm_version=True,
classifiers=classifiers,
description='Color Up Arbitrary Command Output.',
long_description=open('README.md').read(),
entry_points={
'console_scripts': ['colout=colout.colout:main'],
},
long_description=open(os.path.join(os.path.dirname(__file__), 'README.md')).read(),
long_description_content_type='text/markdown;variant=CommonMark',
author='nojhan',
author_email='nojhan@nojhan.net',
url='http://nojhan.github.com/colout/',
packages=packages,
package_data={'': ['LICENSE']},
package_data={'': ['LICENSE', 'README.md']},
package_dir={'colout': 'colout'},
scripts=['bin/colout'],
python_requires='>=3.5',
setup_requires=setup_requires,
include_package_data=True,
install_requires=requires,
license=open('LICENSE').read(),
license='GPLv3',
zip_safe=False,
)

15
tox.ini Normal file
View file

@ -0,0 +1,15 @@
[tox]
envlist=py35,py36,py37,py38,cov
[testenv]
wheel = true
deps=
pytest
pytest-cov
pytest-xdist
setenv=
py{35,36,37,38}: COVERAGE_FILE=.coverage.{envname}
commands=
py{35,36,37,38}: python -m pytest --cov=colout --cov-report=term-missing --no-cov-on-fail
cov: coverage combine
cov: coverage html --fail-under=85