summaryrefslogtreecommitdiff
path: root/lib/spack/llnl/util/tty/color.py
AgeCommit message (Collapse)AuthorFilesLines
2024-01-02Update copyright year to 2024 (#41919)Todd Gamblin1-1/+1
It was time to run `spack license update-copyright-year` again.
2023-12-28shell: fix zsh color formatting for PS1 in environments (#39497)Todd Gamblin1-5/+13
* shell: fix zsh color formatting for PS1 in environments The `colorize` function in `llnl.util.tty.color` only applies proper formatting for Bash ANSI and for console output, but this is not what zsh expects for environment variables. In particular, when using `zsh`, `spack env activate -p` produces a `PS1` prompt that looks like this: ``` \[\033[0;92m\][ENVIRONMENT]\[\033[0m\] ``` For zsh the formatting should be: ``` \e[0;92m[ENVIRONMENT]\e0;m ``` - [x] Add a `zsh` option to `colorize()` to enable zsh color formatting - [x] Add conditional to choose the right `PS1` for `zsh`, `bash`, and `sh` - [x] Don't use color escapes for `sh`, as they don't print properly * convert lots of += lines to triple quotes
2023-07-05Drop Python 2 super syntax (#38718)Adam J. Stewart1-1/+1
2023-07-05Drop Python 2 object subclassing (#38720)Adam J. Stewart1-2/+2
2023-07-04Remove from __future__ imports (#38703)Adam J. Stewart1-2/+0
2023-01-18license year bump (#34921)Harmen Stoppels1-1/+1
* license bump year * fix black issues of modified files * mypy * fix 2021 -> 2023
2023-01-09Support ASCI controlJohn Parent1-0/+58
Windows CMD prompt does not automatically support ASCI color control characters on the console from Python. Enable this behavior by accessing the current console and allowing the interpreation of ASCI control characters from Python via the win32 API.
2022-11-15Stop using `six` in Spack (#33905)Massimiliano Culpo1-3/+1
Since we dropped support for Python 2.7, there's no need so use `six` anymore. We still need to vendor it until we update our vendored dependencies.
2022-10-10shell prompt: enclose control sequence in brackets (#33079)Brian Vanderwende1-3/+9
When setting `PS1` in Bash, it's required to enclose non-printable characters in square brackets, so that the width of the terminal is handled correctly. See https://www.gnu.org/software/bash/manual/bash.html#Controlling-the-Prompt
2022-07-31black: reformat entire repository with blackTodd Gamblin1-44/+46
2022-01-14Update copyright year to 2022Todd Gamblin1-1/+1
2021-07-08imports: sort imports everywhere in Spack (#24695)Todd Gamblin1-1/+1
* fix remaining flake8 errors * imports: sort imports everywhere in Spack We enabled import order checking in #23947, but fixing things manually drives people crazy. This used `spack style --fix --all` from #24071 to automatically sort everything in Spack so PR submitters won't have to deal with it. This should go in after #24071, as it assumes we're using `isort`, not `flake8-import-order` to order things. `isort` seems to be more flexible and allows `llnl` mports to be in their own group before `spack` ones, so this seems like a good switch.
2021-01-02copyrights: update all files with license headers for 2021Todd Gamblin1-1/+1
- [x] add `concretize.lp`, `spack.yaml`, etc. to licensed files - [x] update all licensed files to say 2013-2021 using `spack license update-copyright-year` - [x] appease mypy with some additions to package.py that needed for oneapi.py
2020-05-09bugfix: don't use sys.stdout as a default arg value (#16541)Todd Gamblin1-2/+4
After migrating to `travis-ci.com`, we saw I/O issues in our tests -- tests that relied on `capfd` and `capsys` were failing. We've also seen this in GitHub actions, and it's kept us from switching to them so far. Turns out that the issue is that using streams like `sys.stdout` as default arguments doesn't play well with `pytest` and output redirection, as `pytest` changes the values of `sys.stdout` and `sys.stderr`. if these values are evaluated before output redirection (as they are when used as default arg values), output won't be captured properly later. - [x] replace all stream default arg values with `None`, and only assign stream values inside functions. - [x] fix tests we didn't notice were relying on this erroneous behavior
2019-12-30copyright: update copyright dates for 2020 (#14328)Todd Gamblin1-1/+1
2019-06-07Compiler search uses a pool of workers (#10190)Massimiliano Culpo1-1/+5
- spack.compilers.find_compilers now uses a multiprocess.pool.ThreadPool to execute system commands for the detection of compiler versions. - A few memoized functions have been introduced to avoid poking the filesystem multiple times for the same results. - Performance is much improved, and Spack no longer fork-bombs the system when doing a `compiler find`
2019-01-01copyright: update license headers for 2013-2019 copyright.Todd Gamblin1-1/+1
2018-10-17relicense: replace LGPL headers with Apache-2.0/MIT SPDX headersTodd Gamblin1-23/+4
- remove the old LGPL license headers from all files in Spack - add SPDX headers to all files - core and most packages are (Apache-2.0 OR MIT) - a very small number of remaining packages are LGPL-2.1-only
2018-06-02Fix coloring of error messages containing '}' symbol (#8277)Adam J. Stewart1-6/+25
2018-03-24Update copyright on LLNL files for 2018. (#7592)Todd Gamblin1-1/+1
2017-11-04Replace github.com/llnl/spack with github.com/spack/spack (#6142)Todd Gamblin1-1/+1
We moved to a new GitHub org! Now make the code and docs reflect that.
2017-09-06Update copyright notices for 2017 (#5295)Michael Kuhn1-1/+1
2017-08-01Add `spack dependencies` command and tests for it and dependents.Todd Gamblin1-2/+2
2017-07-31Add --color=[always|never|auto] argument; fix color when piping (#3013)paulhopkins1-6/+54
* Disable spec colorization when redirecting stdout and add command line flag to re-enable * Add command line `--color` flag to control output colorization * Add options to `llnl.util.tty.color` to allow color to be auto/always/never * Add `Spec.cformat()` function to be used when `format()` should have auto-coloring
2017-06-24Make LICENSE recognizable by GitHub. (#4598)Todd Gamblin1-1/+1
2017-04-25Add API Docs for lib/spack/llnl (#3982)Adam J. Stewart1-27/+41
* Add API Docs for lib/spack/llnl * Clean up after previous builds * Better fix for purging API docs
2016-08-10Make Spack core PEP8 compliant.Todd Gamblin1-12/+17
2016-05-11Correct LLNL LGPL license template for clarity.Todd Gamblin1-8/+8
2015-12-09Change github.com/scalability-llnl to github.com/llnl everywhere.Todd Gamblin1-1/+1
2015-10-13Add forgotten file from previous commit.Todd Gamblin1-0/+5
2015-05-29Add ability to force color mode even if terminal is NOT a ttyTodd Gamblin1-2/+6
2014-12-29Fix ColorStreamTodd Gamblin1-9/+12
2014-12-02colify handles ansi color input directly; no more decorator.Todd Gamblin1-0/+5
2014-03-14Moving utilities to a common LLNL package.Todd Gamblin1-0/+190