提交 f3a99869 编写于 作者: R Radostin Stoyanov 提交者: Daniel P. Berrangé

esx_vi_generator: Simplify alignment function

Generate whitespace using the standard function ljust() that is
available in both Py3 [1] and Py2 [2].

1: https://docs.python.org/3/library/stdtypes.html?highlight=strip#str.ljust
2: https://docs.python.org/2.7/library/string.html#string.ljustReviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
Signed-off-by: NRadostin Stoyanov <rstoyanov1@gmail.com>
上级 b89111af
...@@ -49,10 +49,7 @@ separator = "/* " + ("* " * 37) + "*\n" ...@@ -49,10 +49,7 @@ separator = "/* " + ("* " * 37) + "*\n"
def aligned(left, right, length=59): def aligned(left, right, length=59):
while len(left) < length: return left.ljust(length, ' ') + right
left += " "
return left + right
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册