diff --git a/.env.dist b/.env.dist index 875919f8..11962322 100644 --- a/.env.dist +++ b/.env.dist @@ -1,3 +1,3 @@ -VERSION=1.7.0 +VERSION=1.7.1 PYPI_USERNAME=__token__ PYPI_PASSWORD= #api token diff --git a/Makefile b/Makefile index 67ceac51..3d388fd0 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,7 @@ set-version: ## Set new package version if [ ! -f .env ] ; then cp -u .env.dist .env ; fi sed -E -i "s/^VERSION.+/VERSION=$$VERSION/" .env sed -E -i "s/^version.+/version = $$VERSION/" setup.cfg + sed -E -i "s/^__version__.+/__version__ = '$$VERSION'/" ${PROJECT_NAME}/__init__.py echo "Updated version: ${GREEN}$$VERSION${RESET}" generate-readme: ## Generate README file diff --git a/README.md b/README.md index 33d43a57..54f5c8d8 100644 --- a/README.md +++ b/README.md @@ -815,6 +815,10 @@ You can of course create your own sequences and formats, but with one limitation ## Changelog +### v1.7.1 + +- Print reset sequence as `\e[m` instead of `\e[0m`. + ### v1.7.0 - `Format()` constructor can be called without arguments. diff --git a/dev/readme/README.tpl.md b/dev/readme/README.tpl.md index 6b15b542..b4396c8a 100644 --- a/dev/readme/README.tpl.md +++ b/dev/readme/README.tpl.md @@ -720,6 +720,10 @@ You can of course create your own sequences and formats, but with one limitation ## Changelog +### v1.7.1 + +- Print reset sequence as `\e[m` instead of `\e[0m`. + ### v1.7.0 - `Format()` constructor can be called without arguments. diff --git a/pytermor/__init__.py b/pytermor/__init__.py index 209801b8..a52f9f30 100644 --- a/pytermor/__init__.py +++ b/pytermor/__init__.py @@ -21,3 +21,4 @@ 'ReplaceSGR', 'ReplaceNonAsciiBytes', ] +__version__ = '1.7.1' diff --git a/pytermor/seq.py b/pytermor/seq.py index 54a2daaf..29a64d69 100644 --- a/pytermor/seq.py +++ b/pytermor/seq.py @@ -49,9 +49,14 @@ class SequenceSGR(AbstractSequenceCSI, metaclass=ABCMeta): def print(self) -> str: if len(self._params) == 0: return '' + + params = self._params + if params == [0]: # \e[0m <=> \em, saving 1 byte + params = [] + return f'{self.CONTROL_CHARACTER}' \ f'{self.INTRODUCER}' \ - f'{self.SEPARATOR.join([str(param) for param in self._params])}' \ + f'{self.SEPARATOR.join([str(param) for param in params])}' \ f'{self.TERMINATOR}' def __add__(self, other: SequenceSGR) -> SequenceSGR: diff --git a/setup.cfg b/setup.cfg index 62d92d17..a7dd9670 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = pytermor -version = 1.7.0 +version = 1.7.1 author = Aleksandr Shavykin author_email = 0.delameter@gmail.com description = ANSI formatted terminal output library