!10 Fix encode during show(stdout=True)
From: @zhang-liang-pengkun Reviewed-by: @chenwei_kernel Signed-off-by: @chenwei_kernel
This commit is contained in:
commit
4864707660
30
Fix-encode-during-show-stdout-True.patch
Normal file
30
Fix-encode-during-show-stdout-True.patch
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
From 7f124327e8954bbcda68c2832f20b1d0d7a4808b Mon Sep 17 00:00:00 2001
|
||||||
|
From: kiraskyler <80014218+kiraskyler@users.noreply.github.com>
|
||||||
|
Date: Sat, 1 Mar 2025 23:35:22 +0800
|
||||||
|
Subject: [PATCH] Fix encode during show(stdout=True) (#230)
|
||||||
|
|
||||||
|
Co-authored-by: niuwanli <niuwanli@cqsoftware.com.cn>
|
||||||
|
---
|
||||||
|
treelib/tree.py | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/treelib/tree.py b/treelib/tree.py
|
||||||
|
index e27200f..b16baa4 100644
|
||||||
|
--- a/treelib/tree.py
|
||||||
|
+++ b/treelib/tree.py
|
||||||
|
@@ -948,6 +948,7 @@ def show(
|
||||||
|
:param reverse: the ``reverse`` param for sorting :class:`Node` objects in the same level.
|
||||||
|
:param line_type:
|
||||||
|
:param data_property: the property on the node data object to be printed.
|
||||||
|
+ :param stdout: if True print it, if False return printing.
|
||||||
|
:param sorting: if True perform node sorting, if False return
|
||||||
|
nodes in original insertion order. In latter case @key and
|
||||||
|
@reverse parameters are ignored.
|
||||||
|
@@ -975,7 +976,7 @@ def write(line):
|
||||||
|
print("Tree is empty")
|
||||||
|
|
||||||
|
if stdout:
|
||||||
|
- print(self._reader.encode("utf-8"))
|
||||||
|
+ print(self._reader)
|
||||||
|
else:
|
||||||
|
return self._reader
|
||||||
@ -1,12 +1,13 @@
|
|||||||
%global _empty_manifest_terminate_build 0
|
%global _empty_manifest_terminate_build 0
|
||||||
Name: python-treelib
|
Name: python-treelib
|
||||||
Version: 1.7.0
|
Version: 1.7.0
|
||||||
Release: 2
|
Release: 3
|
||||||
Summary: A Python 2/3 implementation of tree structure.
|
Summary: A Python 2/3 implementation of tree structure.
|
||||||
License: Apache-2.0
|
License: Apache-2.0
|
||||||
URL: https://github.com/caesar0301/treelib
|
URL: https://github.com/caesar0301/treelib
|
||||||
Source0: https://files.pythonhosted.org/packages/d8/ec/962387a2bd7ece011f47cfa08f06f832fc9fd41b31f4f0007b8b7948eb93/treelib-1.7.0.tar.gz
|
Source0: https://files.pythonhosted.org/packages/d8/ec/962387a2bd7ece011f47cfa08f06f832fc9fd41b31f4f0007b8b7948eb93/treelib-1.7.0.tar.gz
|
||||||
Patch6000: Escape-double-quotes-in-graphviz-labels.patch
|
Patch6000: Escape-double-quotes-in-graphviz-labels.patch
|
||||||
|
Patch6001: Fix-encode-during-show-stdout-True.patch
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
|
|
||||||
@ -70,6 +71,9 @@ mv %{buildroot}/doclist.lst .
|
|||||||
%{_docdir}/*
|
%{_docdir}/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Apr 21 2025 zhangliangpengkun <zhangliangpengkun@xfusion.com> - 1.7.0-3
|
||||||
|
- DESC:Fix encode during show(stdout=True)
|
||||||
|
|
||||||
* Fri Apr 18 2025 zhangliangpengkun <zhangliangpengkun@xfusion.com> - 1.7.0-2
|
* Fri Apr 18 2025 zhangliangpengkun <zhangliangpengkun@xfusion.com> - 1.7.0-2
|
||||||
- DESC:Escape double quotes in graphviz labels
|
- DESC:Escape double quotes in graphviz labels
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user