feat: github: enter in table is <br/>
This commit is contained in:
parent
62f4d50b0d
commit
ed3e97094e
1 changed files with 10 additions and 7 deletions
|
|
@ -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