summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2014-01-21 16:22:34 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-22 07:26:30 +0000
commit45565b24651ab502ae49dc49261dc3ad5634191f (patch)
tree4a5e9a19dd78f6626a6c201b6503f1c4005a3dbe
parent5fa869007b5ba762bf5679197cf98b1d14a34a22 (diff)
downloadopenembedded-core-45565b24651ab502ae49dc49261dc3ad5634191f.tar.gz
openembedded-core-45565b24651ab502ae49dc49261dc3ad5634191f.tar.bz2
openembedded-core-45565b24651ab502ae49dc49261dc3ad5634191f.zip
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. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/pybootchartgui/pybootchartgui/main.py.in4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/pybootchartgui/pybootchartgui/main.py.in b/scripts/pybootchartgui/pybootchartgui/main.py.in
index cc9c40b178..e9d2c74f1e 100644
--- a/scripts/pybootchartgui/pybootchartgui/main.py.in
+++ b/scripts/pybootchartgui/pybootchartgui/main.py.in
@@ -155,11 +155,13 @@ def main(argv=None):
filename = _get_filename(options.output)
res_list = parsing.split_res(res, options.num)
n = 1
+ width = len(str(len(res_list)))
+ s = "_%%0%dd." % width
for r in res_list:
if len(res_list) == 1:
f = filename + "." + options.format
else:
- f = filename + "_" + str(n) + "." + options.format
+ f = filename + s % n + options.format
n = n + 1
def render():
batch.render(writer, r, options, f)