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, | ||||
|             input, | ||||
|             desc, | ||||
|             ', '.join(tags) or '<none>', | ||||
|             base.wrap(', '.join(tags)) or '<none>', | ||||
|             action.created_at, | ||||
|         ) | ||||
|  | ||||
|   | ||||
| @@ -18,6 +18,7 @@ import abc | ||||
|  | ||||
| from cliff import lister | ||||
| import six | ||||
| import textwrap | ||||
|  | ||||
|  | ||||
| @six.add_metaclass(abc.ABCMeta) | ||||
| @@ -53,3 +54,10 @@ def cut(string, length=25): | ||||
|         return "%s..." % string[:length] | ||||
|     else: | ||||
|         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: | ||||
|         data = ( | ||||
|             workbook.name, | ||||
|             ', '.join(workbook.tags or '') or '<none>', | ||||
|             base.wrap(', '.join(workbook.tags or '')) or '<none>', | ||||
|             workbook.created_at, | ||||
|         ) | ||||
|  | ||||
|   | ||||
| @@ -45,7 +45,7 @@ def format(workflow=None, lister=False): | ||||
|  | ||||
|         data = ( | ||||
|             workflow.name, | ||||
|             ', '.join(tags) or '<none>', | ||||
|             base.wrap(', '.join(tags)) or '<none>', | ||||
|             workflow.input if not lister else base.cut(workflow.input), | ||||
|             workflow.created_at | ||||
|         ) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 hparekh
					hparekh