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",
|
||||
"html": "unsafehtml",
|
||||
}
|
||||
ENTER = {"github": '<br/>'}
|
||||
|
||||
|
||||
class RougailOutputTable:
|
||||
|
|
@ -95,7 +96,8 @@ class RougailOutputTable:
|
|||
if self.datas:
|
||||
datas = []
|
||||
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 = (
|
||||
tabulate(
|
||||
datas,
|
||||
|
|
@ -123,14 +125,15 @@ class RougailOutputTable:
|
|||
for col in self.columns:
|
||||
if col in tags:
|
||||
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':
|
||||
self.datas[namespace]["namespace"] = [namespace]
|
||||
key = namespace
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue