Update to version 3.2.0

This commit is contained in:
lingjuer 2023-07-24 10:08:37 +08:00
parent 8b6e9f5011
commit 50588224bd
4 changed files with 7 additions and 41 deletions

View File

@ -1,37 +0,0 @@
From b391bcaf11f142135f549c1a69fd0c1560f3cff3 Mon Sep 17 00:00:00 2001
From: Matthew Peveler <matt.peveler@gmail.com>
Date: Tue, 27 Dec 2022 09:48:42 -0500
Subject: [PATCH] Fix forcing color through termcolor (#204)
---
tests/test_tldr.py | 3 ++-
tldr.py | 2 ++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/tests/test_tldr.py b/tests/test_tldr.py
index 0ed0dd1..b49c3ed 100644
--- a/tests/test_tldr.py
+++ b/tests/test_tldr.py
@@ -12,7 +12,8 @@
@pytest.mark.parametrize("page_name", page_names)
-def test_whole_page(page_name):
+def test_whole_page(page_name, monkeypatch):
+ monkeypatch.setenv("FORCE_COLOR", "1")
with open(f"tests/data/{page_name}.md", "rb") as f_original:
with open(f"tests/data/{page_name}_rendered", "rb") as f_rendered:
old_stdout = sys.stdout
diff --git a/tldr.py b/tldr.py
index 7e96807..1ac6c39 100755
--- a/tldr.py
+++ b/tldr.py
@@ -493,6 +493,8 @@ def main() -> None:
options = parser.parse_args()
colorama.init(strip=options.color)
+ if options.color is False:
+ os.environ["FORCE_COLOR"] = "true"
if options.update_cache:
update_cache(language=options.language)

Binary file not shown.

Binary file not shown.

View File

@ -1,12 +1,12 @@
Name: tldr
Version: 3.1.0
Release: 2
Version: 3.2.0
Release: 1
Summary: Simplified and community-driven man pages
License: MIT
URL: https://github.com/tldr-pages/tldr-python-client
Source0: https://github.com/tldr-pages/tldr-python-client/archive/%{version}/%{name}-%{version}.tar.gz
Patch0: Fix-forcing-color-through-termcolor.patch
Source0: https://github.com/tldr-pages/tldr-python-client/archive/%{version}/%{name}-%{version}.tar.gz#/tldr-python-client-3.2.0.tar.gz
BuildArch: noarch
BuildRequires: python3-colorama
@ -59,6 +59,9 @@ pytest -k "not test_error_message"
%{python3_sitelib}/%{name}-%{version}-py%{python3_version}.egg-info
%changelog
* Mon Jul 24 2023 zhangchenglin <zhangchenglin@kylinos.cn> - 3.2.0-1
- upgrade version to 3.2.0
* Fri May 05 2023 yaoxin <yao_xin001@hoperun.com> - 3.1.0-2
- Fix compilation errors due to python-termcolor update to 2.3.0