2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

zdtm.py: Make print_sep shorter and print aligned lines

Current implementation of print_sep has off-by-one-like issue -- it
can print one character more :) Fix this and make the code shorter.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2015-10-26 22:37:00 +03:00
parent be0f234fab
commit f49e54f2b0

View File

@@ -659,9 +659,7 @@ def self_checkskip(tname):
return False
def print_sep(title, sep = "="):
sep_len = (80 - len(title) - 2) / 2
sep = sep * sep_len
print "%s %s %s" % (sep, title, sep)
print (" " + title + " ").center(80, sep)
def grep_errors(fname):
print_sep("grep Error")