Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-ansi2html for
openSUSE:Factory checked in at 2022-08-05 19:50:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-ansi2html (Old)
and /work/SRC/openSUSE:Factory/.python-ansi2html.new.1521 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-ansi2html"
Fri Aug 5 19:50:49 2022 rev:5 rq:992783 version:1.8.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-ansi2html/python-ansi2html.changes
2022-04-27 21:42:25.477092365 +0200
+++
/work/SRC/openSUSE:Factory/.python-ansi2html.new.1521/python-ansi2html.changes
2022-08-05 19:51:46.473575513 +0200
@@ -1,0 +2,15 @@
+Thu Aug 4 08:46:29 UTC 2022 - Otto Hollmann <[email protected]>
+
+- Update to 1.8.0:
+ * Fix for ANSI color codes that include blank values (#178)
+ * style.py: Drop unused CSS class .bold (#161)
+ * Added py.typed file (#176)
+ * style.py: Get CSS class .inv_foreground in sync with .body_foreground
(#160)
+ * Fix --input-encoding=<encoding> regression added in PR #143 + related
tests (alternative to PR #162) (#172)
+ * Migrate from mock to unittest.mock of Python >=3.3 (fixes #169) (#171)
+ * Add ability to also recognize colons in ANSI escapes (#167)
+ * Fixes to respect bright colors in palette (#126)
+ * CHANGELOG.rst: Fix misleading 1.6.0 entry and missing 1.7.0 entries (#159)
+ * Add comments to reduce reader research time (#158)
+
+-------------------------------------------------------------------
Old:
----
1.7.0.tar.gz
New:
----
1.8.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-ansi2html.spec ++++++
--- /var/tmp/diff_new_pack.JsSNZ3/_old 2022-08-05 19:51:47.017576917 +0200
+++ /var/tmp/diff_new_pack.JsSNZ3/_new 2022-08-05 19:51:47.021576928 +0200
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-ansi2html
-Version: 1.7.0
+Version: 1.8.0
Release: 0
Summary: Python module to convert text with ANSI color codes to HTML or
LaTeX
License: LGPL-3.0-or-later
++++++ 1.7.0.tar.gz -> 1.8.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi2html-1.7.0/.github/workflows/release.yml
new/ansi2html-1.8.0/.github/workflows/release.yml
--- old/ansi2html-1.7.0/.github/workflows/release.yml 2022-01-28
12:02:38.000000000 +0100
+++ new/ansi2html-1.8.0/.github/workflows/release.yml 2022-07-07
17:31:12.000000000 +0200
@@ -21,6 +21,16 @@
uses: actions/setup-python@v2
with:
python-version: 3.8
+ - name: Install non-PyPI dependencies (Linux only)
+ if: runner.os == 'Linux'
+ run: |
+ set -x
+ sudo apt-get update
+ sudo apt-get install --yes --no-install-recommends -V \
+ docbook-xml \
+ docbook-xsl \
+ libxml2-utils \
+ xsltproc
- name: Install tox
run: >-
python3 -m
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi2html-1.7.0/.github/workflows/tox.yml
new/ansi2html-1.8.0/.github/workflows/tox.yml
--- old/ansi2html-1.7.0/.github/workflows/tox.yml 2022-01-28
12:02:38.000000000 +0100
+++ new/ansi2html-1.8.0/.github/workflows/tox.yml 2022-07-07
17:31:12.000000000 +0200
@@ -72,8 +72,19 @@
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- - name: Install dependencies
+ - name: Install non-PyPI dependencies (Linux only)
+ if: runner.os == 'Linux'
run: |
+ set -x
+ sudo apt-get update
+ sudo apt-get install --yes --no-install-recommends -V \
+ docbook-xml \
+ docbook-xsl \
+ libxml2-utils \
+ xsltproc
+ - name: Install PyPI dependencies
+ run: |
+ set -x
python -m pip install -U pip
pip install tox coverage
- name: Run tox -e ${{ matrix.tox_env }}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi2html-1.7.0/.pre-commit-config.yaml
new/ansi2html-1.8.0/.pre-commit-config.yaml
--- old/ansi2html-1.7.0/.pre-commit-config.yaml 2022-01-28 12:02:38.000000000
+0100
+++ new/ansi2html-1.8.0/.pre-commit-config.yaml 2022-07-07 17:31:12.000000000
+0200
@@ -27,12 +27,12 @@
hooks:
- id: isort
- repo: https://github.com/psf/black.git
- rev: 21.12b0
+ rev: 22.6.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/pre-commit/pre-commit-hooks.git
- rev: v4.1.0
+ rev: v4.3.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
@@ -54,11 +54,11 @@
- flake8-pytest-style>=1.5.0
language_version: python3
- repo: https://github.com/pycqa/pylint
- rev: v2.12.2
+ rev: v2.14.4
hooks:
- id: pylint
- repo: https://github.com/pre-commit/mirrors-mypy
- rev: v0.931
+ rev: v0.961
hooks:
- id: mypy
# empty args needed in order to match mypy cli behavior
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi2html-1.7.0/.pylintrc
new/ansi2html-1.8.0/.pylintrc
--- old/ansi2html-1.7.0/.pylintrc 2022-01-28 12:02:38.000000000 +0100
+++ new/ansi2html-1.8.0/.pylintrc 2022-07-07 17:31:12.000000000 +0200
@@ -13,7 +13,6 @@
missing-class-docstring,
missing-function-docstring,
missing-module-docstring,
- no-self-use,
redefined-builtin,
redefined-outer-name,
too-few-public-methods,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi2html-1.7.0/CHANGELOG.rst
new/ansi2html-1.8.0/CHANGELOG.rst
--- old/ansi2html-1.7.0/CHANGELOG.rst 2022-01-28 12:02:38.000000000 +0100
+++ new/ansi2html-1.8.0/CHANGELOG.rst 2022-07-07 17:31:12.000000000 +0200
@@ -1,3 +1,28 @@
+1.7.0
+-----
+
+Minor Changes
+^^^^^^^^^^^^^
+
+* Replace recommendation of using system packages with pip3 (`#129
<https://github.com/pycontribs/ansi2html/pull/129>`_) @ssbarnea
+* Add truecolor support (`#155
<https://github.com/pycontribs/ansi2html/pull/155>`_) @miltolstoy
+* Generate documentation with Sphinx and use Read the Docs (`#141
<https://github.com/pycontribs/ansi2html/pull/141>`_) @tristanlatr
+* Adds support for OSC hyperlink sequences. (`#131
<https://github.com/pycontribs/ansi2html/pull/131>`_) @hakonhagland
+
+Bugfixes
+^^^^^^^^
+
+* Add test coverage (`#148
<https://github.com/pycontribs/ansi2html/pull/148>`_) @ziegenberg
+* Replace pkg_resources with importlib.metadata (`#144
<https://github.com/pycontribs/ansi2html/pull/144>`_) @ziegenberg
+* fix including of CHANGELOG.rst (`#151
<https://github.com/pycontribs/ansi2html/pull/151>`_) @ziegenberg
+* Update linting dependencies (`#147
<https://github.com/pycontribs/ansi2html/pull/147>`_) @ziegenberg
+* Upgrade the build process (`#145
<https://github.com/pycontribs/ansi2html/pull/145>`_) @ziegenberg
+* Add type hinting (`#143
<https://github.com/pycontribs/ansi2html/pull/143>`_) @ziegenberg
+* Update CI badges in readme (`#142
<https://github.com/pycontribs/ansi2html/pull/142>`_) @ssbarnea
+* Bump setuptools-scm version (`#138
<https://github.com/pycontribs/ansi2html/pull/138>`_) @ssbarnea
+
+Kudos goes to: @hakonhagland, @miltolstoy, @pre-commit-ci,
@pre-commit-ci[bot], @ssbarnea, @tristanlatr and @ziegenberg
+
1.6.0
-----
@@ -17,7 +42,7 @@
Deprecations
^^^^^^^^^^^^
-* Officialy retire support for python <= 3.6 (`#112
<https://github.com/pycontribs/ansi2html/pull/112>`__) @ssbarnea
+* Officially retire support for Python <=3.5 (`#112
<https://github.com/pycontribs/ansi2html/pull/112>`__) @ssbarnea
1.5.2
-----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi2html-1.7.0/MANIFEST.in
new/ansi2html-1.8.0/MANIFEST.in
--- old/ansi2html-1.7.0/MANIFEST.in 2022-01-28 12:02:38.000000000 +0100
+++ new/ansi2html-1.8.0/MANIFEST.in 2022-07-07 17:31:12.000000000 +0200
@@ -1,8 +1,8 @@
include README.rst
include LICENSE
-include Makefile
include man/asciidoc.conf
include man/ansi2html.1
include man/ansi2html.1.txt
+include ansi2html/py.typed
recursive-include tests *
recursive-exclude tests *.pyc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi2html-1.7.0/Makefile new/ansi2html-1.8.0/Makefile
--- old/ansi2html-1.7.0/Makefile 2022-01-28 12:02:38.000000000 +0100
+++ new/ansi2html-1.8.0/Makefile 1970-01-01 01:00:00.000000000 +0100
@@ -1,47 +0,0 @@
-# Copyright (C) 2013 Sebastian Pipping <[email protected]>
-# Licensed under LGPL v3 or later
-
-DESTDIR = /
-SETUP_PY = ./setup.py
-
-A2X = a2x
-PYTHON = python
-RM = rm
-
-GENERATED_FILES = man/ansi2html.1
-
-_MANUAL_PACKAGE = ansi2html
-_MANUAL_TITLE = ansi2html Manual
-_MANUAL_VERSION = $(shell $(PYTHON) setup.py --version)
-
-
-all: $(GENERATED_FILES)
- $(SETUP_PY) build
-
-check: $(GENERATED_FILES)
- $(SETUP_PY) check
- $(SETUP_PY) test
-
-clean:
- $(SETUP_PY) clean
- $(RM) -f $(GENERATED_FILES)
-
-dist: $(GENERATED_FILES)
- $(SETUP_PY) sdist
-
-upload: $(GENERATED_FILES)
- $(SETUP_PY) sdist upload --sign
-
-install: $(GENERATED_FILES)
- $(SETUP_PY) install --root '$(DESTDIR)'
-
-man/ansi2html.1: man/ansi2html.1.txt man/asciidoc.conf Makefile setup.py
- $(A2X) \
- --conf-file=man/asciidoc.conf \
- --attribute="manual_package=$(_MANUAL_PACKAGE)" \
- --attribute="manual_title=$(_MANUAL_TITLE)" \
- --attribute="manual_version=$(_MANUAL_VERSION)" \
- --format=manpage -D man \
- "$<"
-
-.PHONY: all check clean dist install upload
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi2html-1.7.0/ansi2html/converter.py
new/ansi2html-1.8.0/ansi2html/converter.py
--- old/ansi2html-1.7.0/ansi2html/converter.py 2022-01-28 12:02:38.000000000
+0100
+++ new/ansi2html-1.8.0/ansi2html/converter.py 2022-07-07 17:31:12.000000000
+0200
@@ -20,6 +20,7 @@
# along with this program. If not, see
# <http://www.gnu.org/licenses/>.
+import io
import optparse
import re
import sys
@@ -325,7 +326,7 @@
)
self.vt100_box_codes_prog = re.compile("\033\\(([B0])")
- self.ansi_codes_prog = re.compile("\033\\[" "([\\d;]*)" "([a-zA-z])")
+ self.ansi_codes_prog = re.compile("\033\\[([\\d;:]*)([a-zA-z])")
self.url_matcher = re.compile(
r"(((((https?|ftps?|gopher|telnet|nntp)://)|"
r"(mailto:|news:))(%[0-9A-Fa-f]{2}|[-()_.!~*"
@@ -453,8 +454,15 @@
yield CursorMoveUp()
continue
+ while True:
+ param_len = len(params)
+ params = params.replace("::", ":")
+ params = params.replace(";;", ";")
+ if len(params) == param_len:
+ break
+
try:
- params = list(map(int, params.split(";")))
+ params = [int(x) for x in re.split("[;:]", params)]
except ValueError:
params = [ANSI_FULL_RESET]
@@ -626,7 +634,7 @@
else:
_template = _html_template
all_styles = get_styles(self.dark_bg, self.line_wrap, self.scheme)
- backgrounds = all_styles[:6]
+ backgrounds = all_styles[:5]
used_styles = filter(
lambda e: e.klass.lstrip(".") in attrs["styles"], all_styles
)
@@ -786,6 +794,12 @@
title=opts.output_title,
)
+ if hasattr(sys.stdin, "detach") and not isinstance(
+ sys.stdin, io.StringIO
+ ): # e.g. during tests
+ input_buffer = sys.stdin.detach() # type: ignore
+ sys.stdin = io.TextIOWrapper(input_buffer, opts.input_encoding,
"replace")
+
def _print(output_unicode: str, end: str = "\n") -> None:
if hasattr(sys.stdout, "buffer"):
output_bytes = (output_unicode + end).encode(opts.output_encoding)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi2html-1.7.0/ansi2html/style.py
new/ansi2html-1.8.0/ansi2html/style.py
--- old/ansi2html-1.7.0/ansi2html/style.py 2022-01-28 12:02:38.000000000
+0100
+++ new/ansi2html-1.8.0/ansi2html/style.py 2022-07-07 17:31:12.000000000
+0200
@@ -34,10 +34,18 @@
def index(r: int, g: int, b: int) -> str:
+ """
+ Implements the 6x6x6 color cube location of 8bit mode described at
+ https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
+ """
return str(16 + (r * 36) + (g * 6) + b)
def color_component(x: int) -> int:
+ """
+ Implements the 6x6x6 color cube values of 8bit mode described at
+ https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
+ """
if x == 0:
return 0
return 0x37 + (0x28 * x)
@@ -52,10 +60,18 @@
def level(grey: int) -> str:
+ """
+ Implements 24 grey values of 8bit mode described at
+ https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
+ """
return "#%.2x%.2x%.2x" % (((grey * 10) + 8,) * 3)
def index2(grey: int) -> str:
+ """
+ Implements 24 grey location of 8bit mode described at
+ https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
+ """
return str(232 + grey)
@@ -98,6 +114,7 @@
"#00ffff",
"#ffffff",
),
+ # Based on the "osx" palette in previous versions of ansi2html.
"osx": (
"#000000",
"#c23621",
@@ -107,8 +124,54 @@
"#d338d3",
"#33bbc8",
"#cbcccd",
- )
- * 2,
+ "#404040",
+ "#ff7661",
+ "#65fc64",
+ "#eded67",
+ "#896eff",
+ "#ff78ff",
+ "#73fbff",
+ "#ffffff",
+ ),
+ # Based on the "Basic" palette in macOS Terminal.
+ "osx-basic": (
+ "#000000",
+ "#800000",
+ "#008000",
+ "#808000",
+ "#000080",
+ "#800080",
+ "#008080",
+ "#808080",
+ "#666666",
+ "#e60000",
+ "#00d900",
+ "#e6e600",
+ "#0000ff",
+ "#e600e6",
+ "#00e6e6",
+ "#e6e6e6",
+ ),
+ # Based on the "Solid Colors" palette in macOS Terminal.
+ # The colors are brighter than osx-basic.
+ "osx-solid-colors": (
+ "#000000",
+ "#990000",
+ "#00a600",
+ "#999900",
+ "#0000b3",
+ "#b300b3",
+ "#00a6b3",
+ "#bfbfbf",
+ "#666666",
+ "#e60000",
+ "#00d900",
+ "#e6e600",
+ "#0000ff",
+ "#e600e6",
+ "#00e6e6",
+ "#e6e6e6",
+ ),
# http://ethanschoonover.com/solarized
"solarized": (
"#262626",
@@ -178,7 +241,9 @@
def get_styles(
- dark_bg: bool = True, line_wrap: bool = True, scheme: str = "ansi2html"
+ dark_bg: bool = True,
+ line_wrap: bool = True,
+ scheme: str = "ansi2html",
) -> List[Rule]:
css = [
Rule(
@@ -189,13 +254,10 @@
),
Rule(".body_foreground", color=("#000000", "#AAAAAA")[dark_bg]),
Rule(".body_background", background_color=("#AAAAAA",
"#000000")[dark_bg]),
- Rule(
- ".body_foreground > .bold,.bold > .body_foreground,
body.body_foreground > pre > .bold",
- color=("#000000", "#FFFFFF")[dark_bg],
- font_weight=("bold", "normal")[dark_bg],
- ),
- Rule(".inv_foreground", color=("#000000", "#FFFFFF")[not dark_bg]),
+ Rule(".inv_foreground", color=("#000000", "#AAAAAA")[not dark_bg]),
Rule(".inv_background", background_color=("#AAAAAA", "#000000")[not
dark_bg]),
+ # These effects are "SGR (Select Graphic Rendition) parameters"
+ #
https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters
Rule(".ansi1", font_weight="bold"),
Rule(".ansi2", font_weight="lighter"),
Rule(".ansi3", font_style="italic"),
@@ -206,27 +268,40 @@
Rule(".ansi9", text_decoration="line-through"),
]
- # set palette
- pal = SCHEME[scheme]
+ try:
+ pal = SCHEME[scheme]
+ except KeyError as e:
+ raise ValueError(f"Unsupported color scheme {scheme!r}") from e
+
+ if len(pal) < 16:
+ raise Exception(
+ f"Color scheme {scheme!r} specifies fewer than 16 colors. 16
colors are required."
+ )
+
+ # This is 8x2 palette of 3/4-bit color mode described at
+ # https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit
+ # .ansi{30..37} is foreground
+ # .ansi{40..47} is background
for _index in range(8):
css.append(Rule(".ansi3%s" % _index, color=pal[_index]))
css.append(Rule(".inv3%s" % _index, background_color=pal[_index]))
for _index in range(8):
css.append(Rule(".ansi4%s" % _index, background_color=pal[_index]))
css.append(Rule(".inv4%s" % _index, color=pal[_index]))
+
+ # This is the 8x2 bright(!) palette of 4-bit color mode described at
+ # https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit
+ # .ansi{90..97} is foreground
+ # .ansi{100..107} is background
for _index in range(8):
- css.append(Rule(".ansi9%s" % _index, color=intensify(pal[_index],
dark_bg)))
- css.append(
- Rule(".inv9%s" % _index, background_color=intensify(pal[_index],
dark_bg))
- )
+ css.append(Rule(".ansi9%s" % _index, color=pal[_index + 8]))
+ css.append(Rule(".inv9%s" % _index, background_color=pal[_index + 8]))
for _index in range(8):
- css.append(
- Rule(".ansi10%s" % _index, background_color=intensify(pal[_index],
dark_bg))
- )
- css.append(Rule(".inv10%s" % _index, color=intensify(pal[_index],
dark_bg)))
+ css.append(Rule(".ansi10%s" % _index, background_color=pal[_index +
8]))
+ css.append(Rule(".inv10%s" % _index, color=pal[_index + 8]))
- # set palette colors in 256 color encoding
- pal = SCHEME[scheme]
+ # This is the first 16 palette slots of 8-bit color mode described at
+ # https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
for _index in range(len(pal)):
css.append(Rule(".ansi38-%s" % _index, color=pal[_index]))
css.append(Rule(".inv38-%s" % _index, background_color=pal[_index]))
@@ -236,6 +311,10 @@
# css.append("/* Define the explicit color codes (obnoxious) */\n\n")
+ # This is the 6x6x6 color cube of 8-bit mode described at
+ # https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
+ # .ansi38-{16..231} is foreground
+ # .ansi48-{16..231} is background
for green in range(0, 6):
for red in range(0, 6):
for blue in range(0, 6):
@@ -264,6 +343,10 @@
)
)
+ # This is the 24 shades of grey of 8-bit mode described at
+ # https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
+ # .ansi38-{232..255} is foreground
+ # .ansi48-{232..255} is background
for grey in range(0, 24):
css.append(Rule(".ansi38-%s" % index2(grey), color=level(grey)))
css.append(Rule(".inv38-%s" % index2(grey), background=level(grey)))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi2html-1.7.0/tests/ansicolor.html
new/ansi2html-1.8.0/tests/ansicolor.html
--- old/ansi2html-1.7.0/tests/ansicolor.html 2022-01-28 12:02:38.000000000
+0100
+++ new/ansi2html-1.8.0/tests/ansicolor.html 2022-07-07 17:31:12.000000000
+0200
@@ -7,7 +7,6 @@
.ansi2html-content { display: inline; white-space: pre-wrap; word-wrap:
break-word; }
.body_foreground { color: #AAAAAA; }
.body_background { background-color: #000000; }
-.body_foreground > .bold,.bold > .body_foreground, body.body_foreground > pre
> .bold { color: #FFFFFF; font-weight: normal; }
.inv_foreground { color: #000000; }
.inv_background { background-color: #AAAAAA; }
.ansi1 { font-weight: bold; }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi2html-1.7.0/tests/ansicolor_eix.html
new/ansi2html-1.8.0/tests/ansicolor_eix.html
--- old/ansi2html-1.7.0/tests/ansicolor_eix.html 2022-01-28
12:02:38.000000000 +0100
+++ new/ansi2html-1.8.0/tests/ansicolor_eix.html 2022-07-07
17:31:12.000000000 +0200
@@ -7,7 +7,6 @@
.ansi2html-content { display: inline; white-space: pre-wrap; word-wrap:
break-word; }
.body_foreground { color: #AAAAAA; }
.body_background { background-color: #000000; }
-.body_foreground > .bold,.bold > .body_foreground, body.body_foreground > pre
> .bold { color: #FFFFFF; font-weight: normal; }
.inv_foreground { color: #000000; }
.inv_background { background-color: #AAAAAA; }
.ansi1 { font-weight: bold; }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi2html-1.7.0/tests/produce_headers.txt
new/ansi2html-1.8.0/tests/produce_headers.txt
--- old/ansi2html-1.7.0/tests/produce_headers.txt 2022-01-28
12:02:38.000000000 +0100
+++ new/ansi2html-1.8.0/tests/produce_headers.txt 2022-07-07
17:31:12.000000000 +0200
@@ -2,7 +2,6 @@
.ansi2html-content { display: inline; white-space: pre-wrap; word-wrap:
break-word; }
.body_foreground { color: #AAAAAA; }
.body_background { background-color: #000000; }
-.body_foreground > .bold,.bold > .body_foreground, body.body_foreground > pre
> .bold { color: #FFFFFF; font-weight: normal; }
.inv_foreground { color: #000000; }
.inv_background { background-color: #AAAAAA; }
.ansi1 { font-weight: bold; }
@@ -45,36 +44,36 @@
.inv46 { color: #00aaaa; }
.ansi47 { background-color: #F5F1DE; }
.inv47 { color: #F5F1DE; }
-.ansi90 { color: #404356; }
-.inv90 { background-color: #404356; }
-.ansi91 { color: #ea4040; }
-.inv91 { background-color: #ea4040; }
-.ansi92 { color: #40ea40; }
-.inv92 { background-color: #40ea40; }
-.ansi93 { color: #ea9540; }
-.inv93 { background-color: #ea9540; }
-.ansi94 { color: #4040ea; }
-.inv94 { background-color: #4040ea; }
-.ansi95 { color: #ff90e8; }
-.inv95 { background-color: #ff90e8; }
-.ansi96 { color: #40eaea; }
-.inv96 { background-color: #40eaea; }
+.ansi90 { color: #7f7f7f; }
+.inv90 { background-color: #7f7f7f; }
+.ansi91 { color: #ff0000; }
+.inv91 { background-color: #ff0000; }
+.ansi92 { color: #00ff00; }
+.inv92 { background-color: #00ff00; }
+.ansi93 { color: #ffff00; }
+.inv93 { background-color: #ffff00; }
+.ansi94 { color: #5c5cff; }
+.inv94 { background-color: #5c5cff; }
+.ansi95 { color: #ff00ff; }
+.inv95 { background-color: #ff00ff; }
+.ansi96 { color: #00ffff; }
+.inv96 { background-color: #00ffff; }
.ansi97 { color: #ffffff; }
.inv97 { background-color: #ffffff; }
-.ansi100 { background-color: #404356; }
-.inv100 { color: #404356; }
-.ansi101 { background-color: #ea4040; }
-.inv101 { color: #ea4040; }
-.ansi102 { background-color: #40ea40; }
-.inv102 { color: #40ea40; }
-.ansi103 { background-color: #ea9540; }
-.inv103 { color: #ea9540; }
-.ansi104 { background-color: #4040ea; }
-.inv104 { color: #4040ea; }
-.ansi105 { background-color: #ff90e8; }
-.inv105 { color: #ff90e8; }
-.ansi106 { background-color: #40eaea; }
-.inv106 { color: #40eaea; }
+.ansi100 { background-color: #7f7f7f; }
+.inv100 { color: #7f7f7f; }
+.ansi101 { background-color: #ff0000; }
+.inv101 { color: #ff0000; }
+.ansi102 { background-color: #00ff00; }
+.inv102 { color: #00ff00; }
+.ansi103 { background-color: #ffff00; }
+.inv103 { color: #ffff00; }
+.ansi104 { background-color: #5c5cff; }
+.inv104 { color: #5c5cff; }
+.ansi105 { background-color: #ff00ff; }
+.inv105 { color: #ff00ff; }
+.ansi106 { background-color: #00ffff; }
+.inv106 { color: #00ffff; }
.ansi107 { background-color: #ffffff; }
.inv107 { color: #ffffff; }
.ansi38-0 { color: #000316; }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi2html-1.7.0/tests/test_ansi2html.py
new/ansi2html-1.8.0/tests/test_ansi2html.py
--- old/ansi2html-1.7.0/tests/test_ansi2html.py 2022-01-28 12:02:38.000000000
+0100
+++ new/ansi2html-1.8.0/tests/test_ansi2html.py 2022-07-07 17:31:12.000000000
+0200
@@ -24,10 +24,9 @@
import textwrap
from io import StringIO
from os.path import abspath, dirname, join
-from subprocess import run
+from subprocess import PIPE, Popen, run
from typing import List
-
-from mock import patch
+from unittest.mock import patch
from ansi2html import Ansi2HTMLConverter
from ansi2html.converter import (
@@ -470,6 +469,35 @@
result = run(["ansi2html", "--version"], check=True)
assert result.returncode == 0
+ def test_command_input_output_encoding(self) -> None:
+ input_encoding = "utf-16"
+ input_bytes = "regular \033[31mred\033[0m
regular".encode(input_encoding)
+ output_encoding = "utf-32"
+ output_bytes_expected = (
+ 'regular <span style="color: #aa0000">red</span> regular\n'.encode(
+ output_encoding
+ )
+ )
+
+ with Popen(
+ [
+ "ansi2html",
+ "--inline",
+ f"--input-encoding={input_encoding}",
+ f"--output-encoding={output_encoding}",
+ ],
+ stdin=PIPE,
+ stdout=PIPE,
+ ) as process:
+ assert process.stdin # for mypy
+ assert process.stdout # for mypy
+ process.stdin.write(input_bytes)
+ process.stdin.close()
+ stdout_bytes_actual = process.stdout.read()
+
+ assert stdout_bytes_actual == output_bytes_expected
+ assert process.returncode == 0
+
def test_command_module(self) -> None:
result = run(["python3", "-m", "ansi2html", "--version"], check=True)
assert result.returncode == 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi2html-1.7.0/tox.ini new/ansi2html-1.8.0/tox.ini
--- old/ansi2html-1.7.0/tox.ini 2022-01-28 12:02:38.000000000 +0100
+++ new/ansi2html-1.8.0/tox.ini 2022-07-07 17:31:12.000000000 +0200
@@ -13,7 +13,6 @@
# PYTHONWARNINGS=error
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}
deps =
- mock
pytest
pytest-cov
sitepackages = False
@@ -38,14 +37,23 @@
# don't install molecule itself in this env
skip_install = true
deps =
+ asciidoc >= 10.1.4
collective.checkdocs >= 0.2
build >= 0.7.0
pip >= 20.2.2
+ setuptools_scm >= 6.0.1
toml >= 0.10.1
twine >= 3.2.0 # pyup: ignore
setenv =
commands =
rm -rfv {toxinidir}/dist/
+ sh -c 'a2x \
+ --conf-file=man/asciidoc.conf \
+ --attribute="manual_package=ansi2html" \
+ --attribute="manual_title=ansi2html Manual" \
+ --attribute="manual_version=$(python3 -m setuptools_scm)" \
+ --format=manpage -D man \
+ man/ansi2html.1.txt'
python -m build \
--outdir {toxinidir}/dist/ \
{toxinidir}