Skip to content

Commit

Permalink
Cache color func loading, stability fixes for unicode color/stripping…
Browse files Browse the repository at this point in the history
… and newlines
  • Loading branch information
brandonscript committed Apr 1, 2024
1 parent 4e3feee commit c01371d
Show file tree
Hide file tree
Showing 12 changed files with 365 additions and 160 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"commandCenter.border": "#15202b99"
},
"peacock.color": "#61dafb",
"python.testing.pytestArgs": ["-rP -vv --color=yes tests"],
// "python.testing.pytestArgs": ["-rP -vv --color=yes tests"],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.testing.cwd": "${workspaceFolder}",
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Tinta is a magical console output tool with support for printing in beautiful colors and with rich formatting, like bold and underline, using static, chain-able methods. It's so pretty, it's almost like a unicorn!

![version](https://img.shields.io/badge/version-0.1.7b1-green.svg) [_![GitHub Actions Badge](https://img.shields.io/github/actions/workflow/status/brandonscript/tinta/run-tests.yml)_](https://github.com/brandonscript/tinta/actions) [_![Codacy Badge](https://app.codacy.com/project/badge/Grade/32bf3e3172cf434b914647f06569a836)_](https://www.codacy.com/gh/brandonscript/tinta/dashboard?utm_source=github.com&utm_medium=referral&utm_content=brandonscript/tinta&utm_campaign=Badge_Grade) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/tinta) ![MIT License](https://img.shields.io/github/license/brandonscript/tinta) [_![](https://img.shields.io/badge/ethical-source-%23bb8c3c?labelColor=393162)_](https://img.shields.io/badge/ethical-source-%23bb8c3c?labelColor=393162) [_![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)_](code_of_conduct.md)
![version](https://img.shields.io/badge/version-0.1.7b2-green.svg) [_![GitHub Actions Badge](https://img.shields.io/github/actions/workflow/status/brandonscript/tinta/run-tests.yml)_](https://github.com/brandonscript/tinta/actions) [_![Codacy Badge](https://app.codacy.com/project/badge/Grade/32bf3e3172cf434b914647f06569a836)_](https://www.codacy.com/gh/brandonscript/tinta/dashboard?utm_source=github.com&utm_medium=referral&utm_content=brandonscript/tinta&utm_campaign=Badge_Grade) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/tinta) ![MIT License](https://img.shields.io/github/license/brandonscript/tinta) [_![](https://img.shields.io/badge/ethical-source-%23bb8c3c?labelColor=393162)_](https://img.shields.io/badge/ethical-source-%23bb8c3c?labelColor=393162) [_![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)_](code_of_conduct.md)

## Features and Tinta Basics

Expand Down Expand Up @@ -193,7 +193,7 @@ All "add" methods (each color and style method, `Tinta()`, `push()`, and `tint`)

- `s (str)` – A sequence of one or more text strings, to be joined together.
- `sep (str)` – Used to join segment strings. Defaults to `' '`.
> _Note: `sep` behavior has been changed in v0.1.7b1 - if passing a `sep` argument in `print()`, it will overwrite any segment's individual `sep` argument._
> _Note: `sep` behavior has been changed in v0.1.7b2 - if passing a `sep` argument in `print()`, it will overwrite any segment's individual `sep` argument._
For example:

Expand Down Expand Up @@ -228,7 +228,7 @@ All `Tinta` and dynamic color methods will make available the following attribut

_See below for detailed usage and arguments._

> (Note: breaking changes in v0.1.7b1 - several methods have been renamed for better semantics).
> (Note: breaking changes in v0.1.7b2 - several methods have been renamed for better semantics).
- `print()` – Prints to the console.
- `to_str() -> str` – Returns a joined text string.
Expand Down
Binary file removed dist/tinta-0.1.6-py2.py3-none-any.whl
Binary file not shown.
Binary file added dist/tinta-0.1.7b1-py2.py3-none-any.whl
Binary file not shown.
10 changes: 5 additions & 5 deletions examples/complete_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,20 @@
# complex formatting
t = Tinta()
t.vanilla("vanilla").bold("bold", sep="\n")
t.reset()
t.clear()
t.mint("mint").underline("underline", sep="\n")
t.reset()
t.clear()
t.olive("olive").dim("dim", sep="\n")

t.print(end=GAP)

# reset
# clear
t = Tinta()
t.vanilla("vanilla").bold("bold", sep="\n")
t.reset("plain text", sep="\n")
t.clear("plain text", sep="\n")
t.mint("mint").underline("underline", sep="\n")
t.olive("olive inherits underline", sep="\n").dim("dim inherits both", sep="\n")
t.reset("reset clears all", sep="\n")
t.clear("clear clears all", sep="\n")
t.amber("so we can start fresh")

t.print(end=GAP)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

[project]
name = "tinta"
version = "0.1.7b1"
version = "0.1.7b2"
description = "Tinta, a magical console output tool."
authors = [{ name = "Brandon Shelley", email = "[email protected]" }]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

setup(
name="tinta",
version="0.1.7b1",
version="0.1.7b2",
description="Tinta, a magical console output tool.",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
Loading

0 comments on commit c01371d

Please sign in to comment.