Skip to content

Commit

Permalink
Merge pull request #3 from Diapolo10/nightly
Browse files Browse the repository at this point in the history
[PATCH] Support for arbitrary types
  • Loading branch information
Diapolo10 authored Dec 1, 2021
2 parents d1d44ef + e1177fb commit 52b4b08
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ First official documentation.

_______________________________________________________________________________

## [0.1.2] - 2021-12-01

This release adds support for arbitrary types; previously `AnsiEscape` only supported strings.

### Changed

- Changed `AnsiEscape` to support any type
- Updated the localisation files

_______________________________________________________________________________

## [0.1.1] - 2021-12-01

A hotfix release that fixes a problem in the README example code, and adds a screenshot of the code running.
Expand Down
7 changes: 2 additions & 5 deletions escapyde/ansi.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,12 @@ def __str__(self) -> str:
return ''

def __or__(self, other):
if isinstance(other, str):
self.string = other
return self

if isinstance(other, AnsiEscape):
self.sequence += other.sequence
return self

raise TypeError(f"Not compatible with type '{other.__class__.__name__}'")
self.string = str(other)
return self

def __ror__(self, other):
return self.__or__(other)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ __init__.py:F401,F403,F405\

[tool.poetry]
name = 'escapyde'
version = '0.1.1'
version = '0.1.2'
description = "Yet another ANSI escape sequence library for Python - now modernised!"

authors = ["Lari Liuhamo <[email protected]>",]
Expand Down

0 comments on commit 52b4b08

Please sign in to comment.