pybootchartgui: Adopt the width of the index in split output files
Add minimum width zero-padding to the index used in split output files with -s and -o. I.e., if -s 200 is used, then the index will be zero-padded to three digits width. (From OE-Core rev: 45565b24651ab502ae49dc49261dc3ad5634191f) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
9d492a46fa
commit
57c93e3507
|
@ -155,11 +155,13 @@ def main(argv=None):
|
||||||
filename = _get_filename(options.output)
|
filename = _get_filename(options.output)
|
||||||
res_list = parsing.split_res(res, options.num)
|
res_list = parsing.split_res(res, options.num)
|
||||||
n = 1
|
n = 1
|
||||||
|
width = len(str(len(res_list)))
|
||||||
|
s = "_%%0%dd." % width
|
||||||
for r in res_list:
|
for r in res_list:
|
||||||
if len(res_list) == 1:
|
if len(res_list) == 1:
|
||||||
f = filename + "." + options.format
|
f = filename + "." + options.format
|
||||||
else:
|
else:
|
||||||
f = filename + "_" + str(n) + "." + options.format
|
f = filename + s % n + options.format
|
||||||
n = n + 1
|
n = n + 1
|
||||||
def render():
|
def render():
|
||||||
batch.render(writer, r, options, f)
|
batch.render(writer, r, options, f)
|
||||||
|
|
Loading…
Reference in New Issue