The NetBSD Project

CVS log for pkgsrc/textproc/py-colored/Makefile

[BACK] Up to [cvs.NetBSD.org] / pkgsrc / textproc / py-colored

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.16: download - view: text, markup, annotated - select for diffs
Thu Apr 2 08:52:05 2026 UTC (7 months, 2 weeks ago) by adam
Branches: MAIN
CVS tags: pkgsrc-2026Q3-base, pkgsrc-2026Q3, pkgsrc-2026Q2-base, pkgsrc-2026Q2, HEAD
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +2 -2 lines
py-colored: updated to 2.3.2

2.3.2

Added

Added tests_pytest/ suite with pytest-based tests for foreground, background, styles, exceptions, hex color matching, and convert functionality.

Fixed

Fixed mypy type error in hexadecimal.py: changed color parameter type from str | int to str in Hex.find(), as the method requires string input for len() and indexing operations.
Fixed mypy type errors in attributes.py: added missing return type annotation (-> None) to MetaStyle.__getattr__() and replaced bare dict with dict[str, str] for _STYLES and _COLORS class attributes.
Fixed ValueError in Colored.enabled() when FORCE_COLOR environment variable contains a non-integer value (e.g. FORCE_COLOR=yes): invalid values are now treated as enabled.
Fixed Controls.nav() ignoring column=0 due to falsy check: changed if column: to if column is not None: so cursor position at column 0 (start of line) works correctly.
Fixed ValueError crash in Hex.find() when passing an invalid hex string (e.g. #FF, #AABBCCDD): added format validation that raises InvalidHexColor for strings that are not 4 or 7 characters long starting with #.
Fixed RGB values out of range in Utilities.is_percentage(): values are now clamped to [0, 255] to always produce valid ANSI escape sequences without breaking existing code.
Fixed incorrect return type annotation -> None on __getattr__ in MetaStyle, MetaFore, and MetaBack metaclasses: changed to -> NoReturn since these methods always raise an exception and never return.
Fixed Utilities.set_colorterm() losing the default truecolor value when $COLORTERM is not set in the environment: changed fallback from '' to self.colorterm to preserve the initialized default.
Renamed misleading Hex.cube() method to Hex.square() to correctly reflect its calculation (x*x), which is the intended least squares fit operation.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Wed Aug 6 04:53:05 2025 UTC (15 months, 1 week ago) by adam
Branches: MAIN
CVS tags: pkgsrc-2026Q1-base, pkgsrc-2026Q1, pkgsrc-2025Q4-base, pkgsrc-2025Q4, pkgsrc-2025Q3-base, pkgsrc-2025Q3
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +2 -2 lines
py-colored: updated to 2.3.1

2.3.1

Changed

Refactor: Optimized Windows Terminal Mode initialization: Moved Colored.enable_windows_terminal_mode() call from Colored.__init__ to module-level execution. This ensures the Windows virtual terminal processing is enabled only once when the colored module is imported, instead of on every Colored object instantiation. This change improves performance by avoiding redundant API calls and checks.
Refactor: Reduce Colored instance attributes: Removed redundant instance attributes (_ESC, _END, _STYLES, etc.) from the Colored class's __init__ method. These constants are now accessed directly from the Library module, reducing memory footprint per instance and improving adherence to Pylint's R0902 warning.

Fixed

Resolved static analysis warnings in enable_windows_terminal_mode(): Modified enable_windows_terminal_mode() to ensure consistent return statements and handle all possible execution paths explicitly. This addresses mypy's "Missing return statement" error and pylint's "inconsistent-return-statements" warning by making all return paths explicit and robustly handling potential ctypes related exceptions. The return type hint was also updated to Optional[bool].
Resolved type hinting and tuple unpacking warnings in Utilities.is_percentage(): Modified the Utilities.is_percentage() method to explicitly return a fixed-length tuple[int, int, int]. This addresses mypy's "Incompatible return value type" error and pylint's "unbalanced-tuple-unpacking" warning by ensuring consistent and statically verifiable return types.
Refined type validation and error handling in Controls.nav(): Eliminated the redundant _is_str_object static method. Integrated string type validation directly into the nav() method. Replaced AttributeError with TypeError for improved semantic clarity when handling invalid argument types.
Ensured test_hex_1.py correctly uses nearest ANSI codes for hex color representation, preventing InvalidHexColor exceptions during gradient and random color tests.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Wed Feb 12 09:51:10 2025 UTC (21 months ago) by adam
Branches: MAIN
CVS tags: pkgsrc-2025Q2-base, pkgsrc-2025Q2, pkgsrc-2025Q1-base, pkgsrc-2025Q1
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +3 -3 lines
py-colored: updated to 2.3.0

2.3.0

Added:

Convert function that convert ANSI to HEX and opposite.
Test for convert module.

Updated:

convert_percentages(percent: str) to return int.
Improved code quality, type annotation, docstrings.

Fixed:

Duplicated HEX codes.
Utilities for raise InvalidHexColor Exception instead InvalidColor.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Thu Jan 30 12:12:09 2025 UTC (21 months, 2 weeks ago) by adam
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +2 -2 lines
py-colored: updated to 2.2.5

2.2.5
Added
Support static typing

Revision 1.12: download - view: text, markup, annotated - select for diffs
Mon Oct 14 06:46:00 2024 UTC (2 years, 1 month ago) by wiz
Branches: MAIN
CVS tags: pkgsrc-2024Q4-base, pkgsrc-2024Q4
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +1 -3 lines
*: clean-up after python38 removal

Revision 1.11: download - view: text, markup, annotated - select for diffs
Mon Jan 15 13:26:26 2024 UTC (2 years, 10 months ago) by adam
Branches: MAIN
CVS tags: pkgsrc-2024Q3-base, pkgsrc-2024Q3, pkgsrc-2024Q2-base, pkgsrc-2024Q2, pkgsrc-2024Q1-base, pkgsrc-2024Q1
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +2 -3 lines
py-colored: updated to 2.2.4

2.2.4

Fix cprint: don't change fore_color or back_color if they were omitted

Revision 1.10: download - view: text, markup, annotated - select for diffs
Sat Oct 28 19:57:17 2023 UTC (3 years ago) by wiz
Branches: MAIN
CVS tags: pkgsrc-2023Q4-base, pkgsrc-2023Q4
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +2 -1 lines
python/wheel.mk: simplify a lot, and switch to 'installer' for installation

This follows the recommended bootstrap method (flit_core, build, installer).

However, installer installs different files than pip, so update PLISTs
for all packages using wheel.mk and bump their PKGREVISIONs.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Sun Aug 6 07:30:24 2023 UTC (3 years, 3 months ago) by adam
Branches: MAIN
CVS tags: pkgsrc-2023Q3-base, pkgsrc-2023Q3
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +6 -4 lines
py-colored: updated to 2.2.3

Version 2.2.3 - (07-07-2023)

Fixed

Typing error



Version 2.2.2 - (26-06-2023)

Added

Set for environment variable $COLORTERM

Updated

Maximum number range for RGB colors


Version 2.2.1 - (25-06-2023)

Updated

Exception InvalidNavigation -> InvalidControl


Version 2.2.0 - (24-06-2023)

Added

CSI (Control Sequence Introducer) sequences
SGR (Select Graphic Rendition) parameter style underline color
Support RGB color schema

Updated

cprint() to support RGB colors

Fixed

Typo for style 'underlined', changed to 'underline'


Version 2.1.1 - (20-06-2023)

Updated

Legacy support versions 1.x.x:

Functions fg(), bg(), attr() are back until deprecated to the future.

Class attributes fore, back and style will be available also but instead imported them directly, you can use like the examples below:

from colored.foreground import fore
from colored.background import back
from colored.attributes import style


Version 2.1.0 - (20-06-2023)

Updated

Updated library for default values
Replace function show_colour() with cprint()

Added

cprint(text, foreground='', background='', formatting='', reset=True, **kwargs) function


Version 2.0.0 - (19-06-2023)

Updated

Coding style
For typing hints
Class names:

fore -> Fore
back -> Back
style -> Style

Function names:

fg() -> fore()
bg() -> back()
attr() -> style()

Class attributes styles and colors in lower case, example:

Fore.red is the same Fore.RED
Style.bold is the same Style.BOLD

Added

Documentation site: https://dslackw.gitlab.io/colored

Styles italic and strikeout

Function show_colour()

Revision 1.8: download - view: text, markup, annotated - select for diffs
Thu Nov 17 17:32:56 2022 UTC (3 years, 11 months ago) by adam
Branches: MAIN
CVS tags: pkgsrc-2023Q2-base, pkgsrc-2023Q2, pkgsrc-2023Q1-base, pkgsrc-2023Q1, pkgsrc-2022Q4-base, pkgsrc-2022Q4
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +4 -3 lines
py-colored: updated to 1.4.4

Version 1.4.4
Updated
- Code style
- Switch to f string
- Removed python2 support
- Use windows types instead of raw ctypes.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Tue Jan 4 20:54:52 2022 UTC (4 years, 10 months ago) by wiz
Branches: MAIN
CVS tags: pkgsrc-2022Q3-base, pkgsrc-2022Q3, pkgsrc-2022Q2-base, pkgsrc-2022Q2, pkgsrc-2022Q1-base, pkgsrc-2022Q1
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +2 -1 lines
*: bump PKGREVISION for egg.mk users

They now have a tool dependency on py-setuptools instead of a DEPENDS

Revision 1.6: download - view: text, markup, annotated - select for diffs
Mon Oct 25 16:51:47 2021 UTC (5 years ago) by adam
Branches: MAIN
CVS tags: pkgsrc-2021Q4-base, pkgsrc-2021Q4
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +2 -2 lines
py-colored: updated to 1.4.3

Version 1.4.3
Updated
- Improve color enabling

Revision 1.5: download - view: text, markup, annotated - select for diffs
Wed Dec 11 19:04:15 2019 UTC (6 years, 11 months ago) by adam
Branches: MAIN
CVS tags: pkgsrc-2021Q3-base, pkgsrc-2021Q3, pkgsrc-2021Q2-base, pkgsrc-2021Q2, pkgsrc-2021Q1-base, pkgsrc-2021Q1, pkgsrc-2020Q4-base, pkgsrc-2020Q4, pkgsrc-2020Q3-base, pkgsrc-2020Q3, pkgsrc-2020Q2-base, pkgsrc-2020Q2, pkgsrc-2020Q1-base, pkgsrc-2020Q1, pkgsrc-2019Q4-base, pkgsrc-2019Q4
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +2 -2 lines
py-colored: updated to 1.4.2

version 1.4.2:
- Python 3 compatibility
- setup.py file

Version 1.4.1:
- UnsupportedOperation: fileno when detecting TTY

Revision 1.4: download - view: text, markup, annotated - select for diffs
Fri Nov 15 14:19:17 2019 UTC (7 years ago) by adam
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +2 -2 lines
py-colored: updated to 1.4.0

Version 1.4.0:
Added
- Ensure package data is included
- Converted old package spec files to new format
- Hex improvements
- Enable colors in Windows' terminal
- Added an option to make colored tty aware

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sun Jul 29 13:45:22 2018 UTC (8 years, 3 months ago) by nia
Branches: MAIN
CVS tags: pkgsrc-2019Q3-base, pkgsrc-2019Q3, pkgsrc-2019Q2-base, pkgsrc-2019Q2, pkgsrc-2019Q1-base, pkgsrc-2019Q1, pkgsrc-2018Q4-base, pkgsrc-2018Q4, pkgsrc-2018Q3-base, pkgsrc-2018Q3
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +2 -2 lines
textproc/py-colored: use egg.mk.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Fri Jul 27 02:36:04 2018 UTC (8 years, 3 months ago) by nia
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +3 -3 lines
textproc/py-colored: Update to colored-1.3.93

* License changed to MIT.
* Changes to pypi package spec format
* Typo fixes.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Fri Jul 27 02:30:08 2018 UTC (8 years, 3 months ago) by nia
Branches: MAIN
textproc/py-colored: Import colored-1.3.5

colored is a very simple Python library for color and formatting in
terminals.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

CVSweb <webmaster@jp.NetBSD.org>