Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 106357a27c | |||
| ed3e97094e |
3 changed files with 17 additions and 8 deletions
|
|
@ -1,3 +1,9 @@
|
||||||
|
## 0.1.0a2 (2026-01-01)
|
||||||
|
|
||||||
|
### Feat
|
||||||
|
|
||||||
|
- github: enter in table is <br/>
|
||||||
|
|
||||||
## 0.1.0a1 (2025-12-22)
|
## 0.1.0a1 (2025-12-22)
|
||||||
|
|
||||||
## 0.1.0a0 (2025-12-21)
|
## 0.1.0a0 (2025-12-21)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "rougail.output_table"
|
name = "rougail.output_table"
|
||||||
version = "0.1.0a1"
|
version = "0.1.0a2"
|
||||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
description = "Rougail output table"
|
description = "Rougail output table"
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ from .__version__ import __version__
|
||||||
TABULATE = {"console": "plain",
|
TABULATE = {"console": "plain",
|
||||||
"html": "unsafehtml",
|
"html": "unsafehtml",
|
||||||
}
|
}
|
||||||
|
ENTER = {"github": '<br/>'}
|
||||||
|
|
||||||
|
|
||||||
class RougailOutputTable:
|
class RougailOutputTable:
|
||||||
|
|
@ -95,7 +96,8 @@ class RougailOutputTable:
|
||||||
if self.datas:
|
if self.datas:
|
||||||
datas = []
|
datas = []
|
||||||
for data in self.datas.values():
|
for data in self.datas.values():
|
||||||
datas.append(["\n".join(data.get(col, [])) for col in self.columns])
|
enter = ENTER.get(self.output_format, "\n")
|
||||||
|
datas.append([enter.join(data.get(col, [])) for col in self.columns])
|
||||||
msg = (
|
msg = (
|
||||||
tabulate(
|
tabulate(
|
||||||
datas,
|
datas,
|
||||||
|
|
@ -123,14 +125,15 @@ class RougailOutputTable:
|
||||||
for col in self.columns:
|
for col in self.columns:
|
||||||
if col in tags:
|
if col in tags:
|
||||||
value = option.value.get()
|
value = option.value.get()
|
||||||
if isinstance(value, list):
|
|
||||||
self.datas.setdefault(namespace, {}).setdefault(col, []).extend([str(val) for val in value])
|
|
||||||
else:
|
|
||||||
self.datas.setdefault(namespace, {}).setdefault(col, []).append(str(value))
|
|
||||||
if self.first_column == 'namespace':
|
if self.first_column == 'namespace':
|
||||||
self.datas[namespace]["namespace"] = [namespace]
|
key = namespace
|
||||||
else:
|
else:
|
||||||
self.datas[namespace]["description"] = [option.description()]
|
key = option.description()
|
||||||
|
if isinstance(value, list):
|
||||||
|
self.datas.setdefault(key, {}).setdefault(col, []).extend([str(val) for val in value])
|
||||||
|
else:
|
||||||
|
self.datas.setdefault(key, {}).setdefault(col, []).append(str(value))
|
||||||
|
self.datas[key][self.first_column] = [key]
|
||||||
|
|
||||||
|
|
||||||
RougailOutput = RougailOutputTable
|
RougailOutput = RougailOutputTable
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue