mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
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.ljust Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
This commit is contained in:
parent
b89111afed
commit
f3a99869ff
@ -49,10 +49,7 @@ separator = "/* " + ("* " * 37) + "*\n"
|
||||
|
||||
|
||||
def aligned(left, right, length=59):
|
||||
while len(left) < length:
|
||||
left += " "
|
||||
|
||||
return left + right
|
||||
return left.ljust(length, ' ') + right
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user