projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
.gitignore: add some missing files
[babeltrace.git]
/
tests
/
utils
/
python
/
cli_params_to_string.py
diff --git
a/tests/utils/python/cli_params_to_string.py
b/tests/utils/python/cli_params_to_string.py
index f07755c657ad6e86e22eeaf2257ebbf2ce79937d..4ff24987a4e672953e885430fe0e0c2c53bdfe4d 100644
(file)
--- a/
tests/utils/python/cli_params_to_string.py
+++ b/
tests/utils/python/cli_params_to_string.py
@@
-12,19
+12,20
@@
def to_string(p):
# signed integers).
if type(p) is bt2._ArrayValueConst:
# signed integers).
if type(p) is bt2._ArrayValueConst:
- s =
'[{}]'.format(', '
.join([to_string(x) for x in p]))
+ s =
"[{}]".format(", "
.join([to_string(x) for x in p]))
elif type(p) is bt2._MapValueConst:
elif type(p) is bt2._MapValueConst:
- s =
'{{{}}}'
.format(
-
', '.join([k + '='
+ to_string(p[k]) for k in sorted(p.keys())])
+ s =
"{{{}}}"
.format(
+
", ".join([k + "="
+ to_string(p[k]) for k in sorted(p.keys())])
)
elif type(p) is bt2._UnsignedIntegerValueConst:
)
elif type(p) is bt2._UnsignedIntegerValueConst:
- s = str(p) + 'u'
+ s = str(p) + "u"
+ elif type(p) is bt2._RealValueConst:
+ s = "{:.7f}".format(float(p))
elif (
type(p)
in (
bt2._StringValueConst,
bt2._SignedIntegerValueConst,
elif (
type(p)
in (
bt2._StringValueConst,
bt2._SignedIntegerValueConst,
- bt2._RealValueConst,
bt2._BoolValueConst,
)
or p is None
bt2._BoolValueConst,
)
or p is None
@@
-32,6
+33,6
@@
def to_string(p):
s = str(p)
else:
s = str(p)
else:
- raise TypeError(
'Unexpected type'
, type(p))
+ raise TypeError(
"Unexpected type"
, type(p))
return s
return s
This page took
0.024991 seconds
and
4
git commands to generate.