Skip to content

Commit

Permalink
Gray / Bg gray format presets
Browse files Browse the repository at this point in the history
  • Loading branch information
delameter committed Apr 9, 2022
1 parent 60a7c4b commit bf5be84
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .env.dist
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION=1.3.1
VERSION=1.3.2
PYPI_USERNAME=__token__
PYPI_PASSWORD= #api token
13 changes: 4 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,22 @@ set-version: ## set new package version
echo "Updated version: ${GREEN}$$VERSION${RESET}"

build: ## build module
python3 -m build
build: cleanup
sed -E -i "s/^VERSION.+/VERSION=$$VERSION/" .env.dist
python3 -m build

## Making new release (test repo)
## Test repository

upload-dev: ## upload module to test repository
python3 -m twine upload --repository testpypi dist/* -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD}

install-dev: ## install module from test repository
pip install -i https://test.pypi.org/simple/ pytermor-delameter==${VERSION}

release-dev: ## build, upload and install using test repository
release-dev: cleanup build upload-dev install-dev

## Making new release
## Primary repository

upload: ## upload module
python3 -m twine upload dist/* -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD} --verbose

install: ## install module
pip install pytermor==${VERSION}

release: ## build, upload and install module
release: cleanup build upload install
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,11 @@ As a rule of a thumb, **name** equals to **opening seq** in lower case.
<td><code>CYAN</code></td>
<td><code>COLOR_OFF</code></td>
</tr>
<tr>
<td><code>gray</code></td>
<td><code>GRAY</code></td>
<td><code>COLOR_OFF</code></td>
</tr>

<tr><td colspan="3"><br><b>background colors</b></td></tr>
<tr>
Expand Down Expand Up @@ -812,6 +817,11 @@ As a rule of a thumb, **name** equals to **opening seq** in lower case.
<td><code>BG_CYAN</code></td>
<td><code>BG_COLOR_OFF</code></td>
</tr>
<tr>
<td><code>bg_gray</code></td>
<td><code>BG_GRAY</code></td>
<td><code>BG_COLOR_OFF</code></td>
</tr>
</table>

</details>
Expand All @@ -820,6 +830,18 @@ You can of course create your own sequences and formats, but with one limitation

## Changelog

### v1.3.2

Added `gray` and `bg_gray` format presets.

### v1.3.1

Interface revisioning.

### v1.2.1

`opening_seq` and `closing_seq` properties for `Format` class.

### v1.2.0

`EmptySequenceSGR` and `EmptyFormat` classes.
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pytermor
version = 1.3.1
version = 1.3.2
author = Aleksandr Shavykin
author_email = 0.delameter@gmail.com
description = ANSI formatted terminal output library
Expand Down
2 changes: 2 additions & 0 deletions src/pytermor/fmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,12 @@ def autof(*args: str|int|SequenceSGR) -> Format:
blue = autof(code.BLUE)
magenta = autof(code.MAGENTA)
cyan = autof(code.CYAN)
gray = autof(code.GRAY)

bg_red = autof(code.BG_RED)
bg_green = autof(code.BG_GREEN)
bg_yellow = autof(code.BG_YELLOW)
bg_blue = autof(code.BG_BLUE)
bg_magenta = autof(code.BG_MAGENTA)
bg_cyan = autof(code.BG_CYAN)
bg_gray = autof(code.BG_GRAY)

0 comments on commit bf5be84

Please sign in to comment.