Wrapped long lines in the "Tags" column.
Change-Id: I0191402d046bcf6109a0c001d89f52ffe22de890 Closes-Bug: #1449511
This commit is contained in:
@@ -53,7 +53,7 @@ def format(action=None, lister=False):
|
|||||||
action.is_system,
|
action.is_system,
|
||||||
input,
|
input,
|
||||||
desc,
|
desc,
|
||||||
', '.join(tags) or '<none>',
|
base.wrap(', '.join(tags)) or '<none>',
|
||||||
action.created_at,
|
action.created_at,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -18,6 +18,7 @@ import abc
|
|||||||
|
|
||||||
from cliff import lister
|
from cliff import lister
|
||||||
import six
|
import six
|
||||||
|
import textwrap
|
||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
@six.add_metaclass(abc.ABCMeta)
|
||||||
@@ -53,3 +54,10 @@ def cut(string, length=25):
|
|||||||
return "%s..." % string[:length]
|
return "%s..." % string[:length]
|
||||||
else:
|
else:
|
||||||
return string
|
return string
|
||||||
|
|
||||||
|
|
||||||
|
def wrap(string, width=25):
|
||||||
|
if string and len(string) > width:
|
||||||
|
return textwrap.fill(string, width)
|
||||||
|
else:
|
||||||
|
return string
|
||||||
|
@@ -38,7 +38,7 @@ def format(workbook=None):
|
|||||||
if workbook:
|
if workbook:
|
||||||
data = (
|
data = (
|
||||||
workbook.name,
|
workbook.name,
|
||||||
', '.join(workbook.tags or '') or '<none>',
|
base.wrap(', '.join(workbook.tags or '')) or '<none>',
|
||||||
workbook.created_at,
|
workbook.created_at,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -45,7 +45,7 @@ def format(workflow=None, lister=False):
|
|||||||
|
|
||||||
data = (
|
data = (
|
||||||
workflow.name,
|
workflow.name,
|
||||||
', '.join(tags) or '<none>',
|
base.wrap(', '.join(tags)) or '<none>',
|
||||||
workflow.input if not lister else base.cut(workflow.input),
|
workflow.input if not lister else base.cut(workflow.input),
|
||||||
workflow.created_at
|
workflow.created_at
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user